fail_under param not working in .coveragerc

Issue #314 resolved
Micah Hausler created an issue

When I run coverage run test and then coverage report, the output properly reports the coverage at 88% and shows the missing lines, but it exits with a status of 0, where it should fail. If I add --fail-under=100` flag to the command line, it properly fails.

Here is my .coveragerc file:

branch = True
omit =
source = querybuilder
exclude_lines =
    # Have to re-enable the standard pragma
    pragma: no cover

    # Don't complain if tests don't hit defensive assertion code:
    raise NotImplementedError
show_missing = 1

Coverage version is 3.7.1

TravisCI build output:

Comments (6)

  1. Ned Batchelder repo owner

    fail_under isn't an option that can currently be set in the .coveragerc file. It only works if set on the command line. I suppose that could change....

  2. Kristian Glass

    Could this fix see its way to a point-release please, because it's just been the cause of much confusion!

  3. Ned Batchelder repo owner

    @DoISmellBurning I'm sorry, but this change, as small as it seems, depended on some deeper changes that are not in 3.7.1. Also, it's difficult for me to keep two development streams going on a side project.

  4. Log in to comment