Skip to content

Releases: nedbat/coveragepy

coverage-4.1b3

18 May 13:15
Compare
Choose a tag to compare
coverage-4.1b3 Pre-release
Pre-release
  • When running your program, execution can jump from an except X: line to some other line when an exception other than X 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 and coverage --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

18 May 13:15
Compare
Choose a tag to compare
coverage-4.1b2 Pre-release
Pre-release
  • 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 and await 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

18 May 13:15
Compare
Choose a tag to compare
coverage-4.1b1 Pre-release
Pre-release
  • 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 and await 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 or try 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.
  • 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

18 May 13:15
Compare
Choose a tag to compare
  • 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

18 May 13:15
Compare
Choose a tag to compare
  • 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

18 May 13:15
Compare
Choose a tag to compare
  • 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

18 May 13:15
Compare
Choose a tag to compare

No changes from 4.0b3

coverage-4.0b3

18 May 13:15
Compare
Choose a tag to compare
coverage-4.0b3 Pre-release
Pre-release
  • Reporting on an unmeasured file would fail with a traceback. This is now fixed, closing issue 403.
  • The Jenkins ShiningPanda plugin looks for an obsolete file name to find the HTML reports to publish, so it was failing under coverage.py 4.0. Now we create that file if we are running under Jenkins, to keep things working smoothly. issue 404.
  • Kits used to include tests and docs, but didn’t install them anywhere, or provide all of the supporting tools to make them useful. Kits no longer include tests and docs. If you were using them from the older packages, get in touch and help me understand how.

coverage-4.0b2

18 May 13:15
Compare
Choose a tag to compare
coverage-4.0b2 Pre-release
Pre-release
  • 4.0b1 broke --append creating new data files. This is now fixed, closing issue 392.
  • py.test --cov can write empty data, then touch files due to --source, which made coverage.py mistakenly force the data file to record lines instead of arcs. This would lead to a “Can’t combine line data with arc data” error message. This is now fixed, and changed some method names in the CoverageData interface. Fixes issue 399.
  • CoverageData.read_fileobj and CoverageData.write_fileobj replace the .read and .write methods, and are now properly inverses of each other.
  • When using report --skip-covered, a message will now be included in the report output indicating how many files were skipped, and if all files are skipped, coverage.py won’t accidentally scold you for having no data to report. Thanks, Krystian Kichewko.
  • A new conversion utility has been added: python -m coverage.pickle2json will convert v3.x pickle data files to v4.x JSON data files. Thanks, Alexander Todorov. Closes issue 395.
  • A new version identifier is available, coverage.version_info, a plain tuple of values similar to sys.version_info.

coverage-4.0b1

18 May 13:15
Compare
Choose a tag to compare
coverage-4.0b1 Pre-release
Pre-release
  • Coverage.py is now licensed under the Apache 2.0 license. See NOTICE.txt for details. Closes issue 313.
  • The data storage has been completely revamped. The data file is now JSON-based instead of a pickle, closing issue 236. The CoverageData class is now a public supported documented API to the data file.
  • A new configuration option, [run] note, lets you set a note that will be stored in the runs section of the data file. You can use this to annotate the data file with any information you like.
  • Unrecognized configuration options will now print an error message and stop coverage.py. This should help prevent configuration mistakes from passing silently. Finishes issue 386.
  • In parallel mode, coverage erase will now delete all of the data files, fixing issue 262.
  • Coverage.py now accepts a directory name for coverage run and will run a __main__.py found there, just like Python will. Fixes issue 252. Thanks, Dmitry Trofimov.
  • The XML report now includes a missing-branches attribute. Thanks, Steve Peak. This is not a part of the Cobertura DTD, so the XML report no longer references the DTD.
  • Missing branches in the HTML report now have a bit more information in the right-hand annotations. Hopefully this will make their meaning clearer.
  • All the reporting functions now behave the same if no data had been collected, exiting with a status code of 1. Fixed fail_under to be applied even when the report is empty. Thanks, Ionel Cristian Mărieș.
  • Plugins are now initialized differently. Instead of looking for a class called Plugin, coverage.py looks for a function called coverage_init.
  • A file-tracing plugin can now ask to have built-in Python reporting by returning “python” from its file_reporter() method.
  • Code that was executed with exec would be mis-attributed to the file that called it. This is now fixed, closing issue 380.
  • The ability to use item access on Coverage.config (introduced in 4.0a2) has been changed to a more explicit Coverage.get_option and Coverage.set_option API.
  • The Coverage.use_cache method is no longer supported.
  • The private method Coverage._harvest_data is now called Coverage.get_data, and returns the CoverageData containing the collected data.
  • The project is consistently referred to as “coverage.py” throughout the code and the documentation, closing issue 275.
  • Combining data files with an explicit configuration file was broken in 4.0a6, but now works again, closing issue 385.
  • coverage combine now accepts files as well as directories.
  • The speed is back to 3.7.1 levels, after having slowed down due to plugin support, finishing up issue 387.