Skip to content

Releases: nedbat/coveragepy

coverage-3.5

18 May 13:15
Compare
Choose a tag to compare
  • The HTML report hotkeys now behave slightly differently when the current chunk isn’t visible at all: a chunk on the screen will be selected, instead of the old behavior of jumping to the literal next chunk. The hotkeys now work in Google Chrome. Thanks, Guido van Rossum.

coverage-3.5b1

18 May 13:15
Compare
Choose a tag to compare
coverage-3.5b1 Pre-release
Pre-release
  • The HTML report now has hotkeys. Try n, s, m, x, b, p, and c on the overview page to change the column sorting. On a file page, r, m, x, and p toggle the run, missing, excluded, and partial line markings. You can navigate the highlighted sections of code by using the j and k keys for next and previous. The 1 (one) key jumps to the first highlighted section in the file, and 0 (zero) scrolls to the top of the file.
  • The --omit and --include switches now interpret their values more usefully. If the value starts with a wildcard character, it is used as-is. If it does not, it is interpreted relative to the current directory. Closes issue 121.
  • Partial branch warnings can now be pragma’d away. The configuration option partial_branches is a list of regular expressions. Lines matching any of those expressions will never be marked as a partial branch. In addition, there’s a built-in list of regular expressions marking statements which should never be marked as partial. This list includes while True:, while 1:, if 1:, and if 0:.
  • The coverage() constructor accepts single strings for the omit= and include= arguments, adapting to a common error in programmatic use.
  • Modules can now be run directly using coverage run -m modulename, to mirror Python’s -m flag. Closes issue 95, thanks, Brandon Rhodes.
  • coverage run didn’t emulate Python accurately in one small detail: the current directory inserted into sys.path was relative rather than absolute. This is now fixed.
  • HTML reporting is now incremental: a record is kept of the data that produced the HTML reports, and only files whose data has changed will be generated. This should make most HTML reporting faster.
  • Pathological code execution could disable the trace function behind our backs, leading to incorrect code measurement. Now if this happens, coverage.py will issue a warning, at least alerting you to the problem. Closes issue 93. Thanks to Marius Gedminas for the idea.
  • The C-based trace function now behaves properly when saved and restored with sys.gettrace() and sys.settrace(). This fixes issue 125 and issue 123. Thanks, Devin Jeanpierre.
  • Source files are now opened with Python 3.2’s tokenize.open() where possible, to get the best handling of Python source files with encodings. Closes issue 107, thanks, Brett Cannon.
  • Syntax errors in supposed Python files can now be ignored during reporting with the -i switch just like other source errors. Closes issue 115.
  • Installation from source now succeeds on machines without a C compiler, closing issue 80.
  • Coverage.py can now be run directly from a working tree by specifying the directory name to python: python coverage_py_working_dir run .... Thanks, Brett Cannon.
  • A little bit of Jython support: coverage run can now measure Jython execution by adapting when $py.class files are traced. Thanks, Adi Roiban. Jython still doesn’t provide the Python libraries needed to make coverage reporting work, unfortunately.
  • Internally, files are now closed explicitly, fixing issue 104. Thanks, Brett Cannon.

coverage-3.4

18 May 13:15
Compare
Choose a tag to compare
  • The XML report is now sorted by package name, fixing issue 88.
  • Programs that exited with sys.exit() with no argument weren’t handled properly, producing a coverage.py stack trace. That is now fixed.

coverage-3.4b2

18 May 13:15
Compare
Choose a tag to compare
coverage-3.4b2 Pre-release
Pre-release
  • Completely unexecuted files can now be included in coverage results, reported as 0% covered. This only happens if the –source option is specified, since coverage.py needs guidance about where to look for source files.
  • The XML report output now properly includes a percentage for branch coverage, fixing issue 65 and issue 81.
  • Coverage percentages are now displayed uniformly across reporting methods. Previously, different reports could round percentages differently. Also, percentages are only reported as 0% or 100% if they are truly 0 or 100, and are rounded otherwise. Fixes issue 41 and issue 70.
  • The precision of reported coverage percentages can be set with the [report] precision config file setting. Completes issue 16.
  • Threads derived from threading.Thread with an overridden run method would report no coverage for the run method. This is now fixed, closing issue 85.

coverage-3.4b1

18 May 13:15
Compare
Choose a tag to compare
coverage-3.4b1 Pre-release
Pre-release
  • BACKWARD INCOMPATIBILITY: the --omit and --include switches now take file patterns rather than file prefixes, closing issue 34 and issue 36.
  • BACKWARD INCOMPATIBILITY: the omit_prefixes argument is gone throughout coverage.py, replaced with omit, a list of file name patterns suitable for fnmatch. A parallel argument include controls what files are included.
  • The run command now has a --source switch, a list of directories or module names. If provided, coverage.py will only measure execution in those source files.
  • Various warnings are printed to stderr for problems encountered during data measurement: if a --source module has no Python source to measure, or is never encountered at all, or if no data is collected.
  • The reporting commands (report, annotate, html, and xml) now have an --include switch to restrict reporting to modules matching those file patterns, similar to the existing --omit switch. Thanks, Zooko.
  • The run command now supports --include and --omit to control what modules it measures. This can speed execution and reduce the amount of data during reporting. Thanks Zooko.
  • Since coverage.py 3.1, using the Python trace function has been slower than it needs to be. A cache of tracing decisions was broken, but has now been fixed.
  • Python 2.7 and 3.2 have introduced new opcodes that are now supported.
  • Python files with no statements, for example, empty __init__.py files, are now reported as having zero statements instead of one. Fixes issue 1.
  • Reports now have a column of missed line counts rather than executed line counts, since developers should focus on reducing the missed lines to zero, rather than increasing the executed lines to varying targets. Once suggested, this seemed blindingly obvious.
  • Line numbers in HTML source pages are clickable, linking directly to that line, which is highlighted on arrival. Added a link back to the index page at the bottom of each HTML page.
  • Programs that call os.fork will properly collect data from both the child and parent processes. Use coverage run -p to get two data files that can be combined with coverage combine. Fixes issue 56.
  • Coverage.py is now runnable as a module: python -m coverage. Thanks, Brett Cannon.
  • When measuring code running in a virtualenv, most of the system library was being measured when it shouldn’t have been. This is now fixed.
  • Doctest text files are no longer recorded in the coverage data, since they can’t be reported anyway. Fixes issue 52 and issue 61.
  • Jinja HTML templates compile into Python code using the HTML file name, which confused coverage.py. Now these files are no longer traced, fixing issue 82.
  • Source files can have more than one dot in them (foo.test.py), and will be treated properly while reporting. Fixes issue 46.
  • Source files with DOS line endings are now properly tokenized for syntax coloring on non-DOS machines. Fixes issue 53.
  • Unusual code structure that confused exits from methods with exits from classes is now properly analyzed. See issue 62.
  • Asking for an HTML report with no files now shows a nice error message rather than a cryptic failure (‘int’ object is unsubscriptable). Fixes issue 59.

coverage-3.3.1

18 May 13:15
Compare
Choose a tag to compare
  • Using parallel=True in .coveragerc file prevented reporting, but now does not, fixing issue 49.
  • When running your code with “coverage run”, if you call sys.exit(), coverage.py will exit with that status code, fixing issue 50.

coverage-3.3

18 May 13:15
Compare
Choose a tag to compare
  • Settings are now read from a .coveragerc file. A specific file can be specified on the command line with –rcfile=FILE. The name of the file can be programmatically set with the config_file argument to the coverage() constructor, or reading a config file can be disabled with config_file=False.
  • Fixed a problem with nested loops having their branch possibilities mischaracterized: issue 39.
  • Added coverage.process_start to enable coverage measurement when Python starts.
  • Parallel data file names now have a random number appended to them in addition to the machine name and process id.
  • Parallel data files combined with “coverage combine” are deleted after they’re combined, to clean up unneeded files. Fixes issue 40.
  • Exceptions thrown from product code run with “coverage run” are now displayed without internal coverage.py frames, so the output is the same as when the code is run without coverage.py.
  • The data_suffix argument to the coverage constructor is now appended with an added dot rather than simply appended, so that .coveragerc files will not be confused for data files.
  • Python source files that don’t end with a newline can now be executed, fixing issue 47.
  • Added an AUTHORS.txt file.

coverage-3.2

18 May 13:15
Compare
Choose a tag to compare
  • Added a --version option on the command line.

coverage-3.2b4

18 May 13:15
Compare
Choose a tag to compare
coverage-3.2b4 Pre-release
Pre-release
  • Branch coverage improvements:
    • The XML report now includes branch information.
  • Click-to-sort HTML report columns are now persisted in a cookie. Viewing a report will sort it first the way you last had a coverage report sorted. Thanks, Chris Adams.
  • On Python 3.x, setuptools has been replaced by Distribute.

coverage-3.2b3

18 May 13:15
Compare
Choose a tag to compare
coverage-3.2b3 Pre-release
Pre-release
  • Fixed a memory leak in the C tracer that was introduced in 3.2b1.
  • Branch coverage improvements:
    • Branches to excluded code are ignored.
  • The table of contents in the HTML report is now sortable: click the headers on any column. Thanks, Chris Adams.