Version 4.1b1 — 2016-01-10
- Branch analysis has been rewritten: it used to be based on bytecode, but now uses AST analysis. This has changed a number of things:
- More code paths are now considered runnable, especially in
try
/except
structures. This may mean that coverage.py will identify more code paths as uncovered. This could either raise or lower your overall coverage number. - Python 3.5’s
async
andawait
keywords are properly supported, fixing issue 434. - Some long-standing branch coverage bugs were fixed:
- issue 129: functions with only a docstring for a body would incorrectly report a missing branch on the
def
line. - issue 212: code in an
except
block could be incorrectly marked as a missing branch. - issue 146: context managers (
with
statements) in a loop ortry
block could confuse the branch measurement, reporting incorrect partial branches. - issue 422: in Python 3.5, an actual partial branch could be marked as complete.
- issue 129: functions with only a docstring for a body would incorrectly report a missing branch on the
- More code paths are now considered runnable, especially in
- Pragmas to disable coverage measurement can now be used on decorator lines, and they will apply to the entire function or class being decorated. This implements the feature requested in issue 131.
- Multiprocessing support is now available on Windows. Thanks, Rodrigue Cloutier.
- Files with two encoding declarations are properly supported, fixing issue 453. Thanks, Max Linke.
- Non-ascii characters in regexes in the configuration file worked in 3.7, but stopped working in 4.0. Now they work again, closing issue 455.
- Form-feed characters would prevent accurate determination of the beginning of statements in the rest of the file. This is now fixed, closing issue 461.
➡️ PyPI page: coverage 4.1b1.
➡️ To install: python3 -m pip install coverage==4.1b1