Error on unrecognised configuration directive in .coveragerc

Issue #386 resolved
Kristian Glass created an issue

I'd love it if coverage gave me an error if it encountered unrecognised directives in .coveragerc

Spot the problems with these files:

source = foo

branch = True

Did you notice that branch was in the report section when it should have been in run? You probably did, because you were deliberately looking for mistakes and it's a short file, but it's very easy to miss at a glance!

What about:

fail_under = 100

I cheated here. That's absolutely fine if you're using 4.0aSomething, but 3.7.1 doesn't support that directive (#314) which is entirely reasonable, but it's sure unpleasant to discover that you thought you were mandating 100% coverage but actually weren't...!

Some sort of "I don't know what to do with foo!" reporting, even if just a warning/informational message, would be incredibly useful please!

Comments (7)

  1. Ned Batchelder repo owner

    We might have just set a record for shortest time between suggesting a feature, and implementing it: 9f3a10cb5a0d

    I'm not doing any more work on the 3.x line, but I will make the docs clearer about what is new in 4.0.

  2. Kristian Glass reporter

    <3 thanks very much! :D

    Cheeky question - any feel for when there might be a definitive 4.x release? We've totally got stuff still on 3.7, and won't bump things until there's a stable version to bump to...

  3. Ned Batchelder repo owner

    Hmm, 4.0 is getting closer, but it has been a while. I would estimate a 4.0 final in perhaps two-month's time. doesn't like requirement specs like coverage>=4.0a6 ? Or direct bitbucket or github urls?

  4. Kristian Glass reporter

    Awesome thanks :)

    We have a policy of pinning test dependency versions, and won't prompt to upgrade existing projects with coverage==3.7.1 - we hand-update when we notice, but it's easy to miss!

  5. Log in to comment