Issue #103 invalid

exit status is not propagated

Devin Bayer
created an issue

When the command being executed fails, coverage still returns with a zero exit status. This means I can't use it to measure coverage of my unit tests and test if the unit tests succeed.

./manage.py test --with-xunit # $? == 1

coverage ./manage.py test --with-xunit # $? == 0

Comments (3)

  1. Ned Batchelder repo owner

    A quick look at the inside of Django's manage.py, it looks like it depends on a call to sys.exit() somewhere deep in the command. Coverage catches SystemExit to return the proper status code, so I'm not sure what's going on here.

  2. Devin Bayer reporter

    Hi. Now I see the problem. I am using buildout (z3c.recipe.scripts) and the generated scripts don't include sys.exit():

    if __name__ == '__main__':
        coverage.main()
    

    unlike easy_install:

    sys.exit(
       load_entry_point('coverage==3.4', 'console_scripts', 'coverage')()
    )
    

    I have reported the discrepancy, but it would be nice if coverage.main() called sys.exit()

  3. Log in to comment