Releases: nedbat/coveragepy
Releases · nedbat/coveragepy
coverage-4.2
- Since
concurrency=multiprocessing
uses subprocesses, options specified on the coverage.py command line will not be communicated down to them. Only options in the configuration file will apply to the subprocesses. Previously, the options didn’t apply to the subprocesses, but there was no indication. Now it is an error to use--concurrency=multiprocessing
and other run-affecting options on the command line. This prevents failures like those reported in issue 495. - Filtering the HTML report is now faster, thanks to Ville Skyttä.
coverage-4.2b1
Work from the PyCon 2016 Sprints!
- BACKWARD INCOMPATIBILITY: the
coverage combine
command now ignores an existing.coverage
data file. It used to include that file in its combining. This caused confusing results, and extra tox “clean” steps. If you want the old behavior, use the newcoverage combine --append
option. - The
concurrency
option can now take multiple values, to support programs using multiprocessing and another library such as eventlet. This is only possible in the configuration file, not from the command line. The configuration file is the only way for sub-processes to all run with the same options. Fixes issue 484. Thanks to Josh Williams for prototyping. - Using a
concurrency
setting ofmultiprocessing
now implies--parallel
so that the main program is measured similarly to the sub-processes. - When using automatic subprocess measurement, running coverage commands would create spurious data files. This is now fixed, thanks to diagnosis and testing by Dan Riti. Closes issue 492.
- A new configuration option,
report:sort
, controls what column of the text report is used to sort the rows. Thanks to Dan Wandschneider, this closes issue 199. - The HTML report has a more-visible indicator for which column is being sorted. Closes issue 298, thanks to Josh Williams.
- If the HTML report cannot find the source for a file, the message now suggests using the
-i
flag to allow the report to continue. Closes issue 231, thanks, Nathan Land. - When reports are ignoring errors, there’s now a warning if a file cannot be parsed, rather than being silently ignored. Closes issue 396. Thanks, Matthew Boehm.
- A new option for
coverage debug
is available:coverage debug config
shows the current configuration. Closes issue 454, thanks to Matthew Boehm. - Running coverage as a module (
python -m coverage
) no longer shows the program name as__main__.py
. Fixes issue 478. Thanks, Scott Belden. - The test_helpers module has been moved into a separate pip-installable package: unittest-mixins.
coverage-4.1
- The internal attribute Reporter.file_reporters was removed in 4.1b3. It should have come has no surprise that there were third-party tools out there using that attribute. It has been restored, but with a deprecation warning.
coverage-4.1b3
- When running your program, execution can jump from an
except X:
line to some other line when an exception other thanX
happens. This jump is no longer considered a branch when measuring branch coverage. - When measuring branch coverage,
yield
statements that were never resumed were incorrectly marked as missing, as reported in issue 440. This is now fixed. - During branch coverage of single-line callables like lambdas and generator expressions, coverage.py can now distinguish between them never being called, or being called but not completed. Fixes issue 90, issue 460 and issue 475.
- The HTML report now has a map of the file along the rightmost edge of the page, giving an overview of where the missed lines are. Thanks, Dmitry Shishov.
- The HTML report now uses different monospaced fonts, favoring Consolas over Courier. Along the way, issue 472 about not properly handling one-space indents was fixed. The index page also has slightly different styling, to try to make the clickable detail pages more apparent.
- Missing branches reported with
coverage report -m
will now say->exit
for missed branches to the exit of a function, rather than a negative number. Fixes issue 469. coverage --help
andcoverage --version
now mention which tracer is installed, to help diagnose problems. The docs mention which features need the C extension. (issue 479)- Officially support PyPy 5.1, which required no changes, just updates to the docs.
- The Coverage.report function had two parameters with non-None defaults, which have been changed. show_missing used to default to True, but now defaults to None. If you had been calling Coverage.report without specifying show_missing, you’ll need to explicitly set it to True to keep the same behavior. skip_covered used to default to False. It is now None, which doesn’t change the behavior. This fixes issue 485.
- It’s never been possible to pass a namespace module to one of the analysis functions, but now at least we raise a more specific error message, rather than getting confused. (issue 456)
- The coverage.process_startup function now returns the Coverage instance it creates, as suggested in issue 481.
- Make a small tweak to how we compare threads, to avoid buggy custom comparison code in thread classes. (issue 245)
coverage-4.1b2
- Problems with the new branch measurement in 4.1 beta 1 were fixed:
- Class docstrings were considered executable. Now they no longer are.
yield from
andawait
were considered returns from functions, since they could transfer control to the caller. This produced unhelpful “missing branch” reports in a number of circumstances. Now they no longer are considered returns.- In unusual situations, a missing branch to a negative number was reported. This has been fixed, closing issue 466.
- The XML report now produces correct package names for modules found in directories specified with
source=
. Fixes issue 465. coverage report
won’t produce trailing whitespace.
coverage-4.1b1
- 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.
coverage-4.0.3
- Fixed a mysterious problem that manifested in different ways: sometimes hanging the process (issue 420), sometimes making database connections fail (issue 445).
- The XML report now has correct
<source>
elements when using a--source=
option somewhere besides the current directory. This fixes issue 439. Thanks, Arcadiy Ivanov. - Fixed an unusual edge case of detecting source encodings, described in issue 443.
- Help messages that mention the command to use now properly use the actual command name, which might be different than “coverage”. Thanks to Ben Finney, this closes issue 438.
coverage-4.0.2
- More work on supporting unusually encoded source. Fixed issue 431.
- Files or directories with non-ASCII characters are now handled properly, fixing issue 432.
- Setting a trace function with sys.settrace was broken by a change in 4.0.1, as reported in issue 436. This is now fixed.
- Officially support PyPy 4.0, which required no changes, just updates to the docs.
coverage-4.0.1
- When combining data files, unreadable files will now generate a warning instead of failing the command. This is more in line with the older coverage.py v3.7.1 behavior, which silently ignored unreadable files. Prompted by issue 418.
- The –skip-covered option would skip reporting on 100% covered files, but also skipped them when calculating total coverage. This was wrong, it should only remove lines from the report, not change the final answer. This is now fixed, closing issue 423.
- In 4.0, the data file recorded a summary of the system on which it was run. Combined data files would keep all of those summaries. This could lead to enormous data files consisting of mostly repetitive useless information. That summary is now gone, fixing issue 415. If you want summary information, get in touch, and we’ll figure out a better way to do it.
- Test suites that mocked os.path.exists would experience strange failures, due to coverage.py using their mock inadvertently. This is now fixed, closing issue 416.
- Importing a
__init__
module explicitly would lead to an error:AttributeError: 'module' object has no attribute '__path__'
, as reported in issue 410. This is now fixed. - Code that uses
sys.settrace(sys.gettrace())
used to incur a more than 2x speed penalty. Now there’s no penalty at all. Fixes issue 397. - Pyexpat C code will no longer be recorded as a source file, fixing issue 419.
- The source kit now contains all of the files needed to have a complete source tree, re-fixing issue 137 and closing issue 281.
coverage-4.0
No changes from 4.0b3