Releases: nedbat/coveragepy
Releases · nedbat/coveragepy
coverage-5.0.3
- A performance improvement in 5.0.2 didn’t work for test suites that changed directory before combining data, causing “Couldn’t use data file: no such table: meta” errors (issue 916). This is now fixed.
- Coverage could fail to run your program with some form of “ModuleNotFound” or “ImportError” trying to import from the current directory. This would happen if coverage had been packaged into a zip file (for example, on Windows), or was found indirectly (for example, by pyenv-virtualenv). A number of different scenarios were described in issue 862 which is now fixed. Huge thanks to Agbonze O. Jeremiah for reporting it, and Alexander Waters and George-Cristian Bîrzan for protracted debugging sessions.
- Added the “premain” debug option.
- Added SQLite compile-time options to the “debug sys” output.
coverage-5.0.2
- Programs that used multiprocessing and changed directories would fail under coverage. This is now fixed (issue 890). A side effect is that debug information about the config files read now shows absolute paths to the files.
- When running programs as modules (
coverage run -m
) with--source
, some measured modules were imported before coverage starts. This resulted in unwanted warnings (“Already imported a file that will be measured”) and a reduction in coverage totals (issue 909). This is now fixed. - If no data was collected, an exception about “No data to report” could happen instead of a 0% report being created (issue 884). This is now fixed.
- The handling of source files with non-encodable file names has changed. Previously, if a file name could not be encoded as UTF-8, an error occurred, as described in issue 891. Now, those files will not be measured, since their data would not be recordable.
- A new warning (“dynamic-conflict”) is issued if two mechanisms are trying to change the dynamic context. Closes issue 901.
coverage run --debug=sys
would fail with an AttributeError. This is now fixed (issue 907).
coverage-5.0.1
- If a 4.x data file is the cause of a “file is not a database” error, then use a more specific error message, “Looks like a coverage 4.x data file, are you mixing versions of coverage?” Helps diagnose the problems described in issue 886.
- Measurement contexts and relative file names didn’t work together, as reported in issue 899 and issue 900. This is now fixed, thanks to David Szotten.
- When using
coverage run --concurrency=multiprocessing
, all data files should be named with parallel-ready suffixes. 5.0 mistakenly named the main process’ file with no suffix when using--append
. This is now fixed, closing issue 880. - Fixed a problem on Windows when the current directory is changed to a different drive (issue 895). Thanks, Olivier Grisel.
- Updated Python 3.9 support to 3.9a2.
coverage-5.0
Nothing new beyond 5.0b2.
coverage-5.0b2
- An experimental
[run] relative_files
setting tells coverage to store relative file names in the data file. This makes it easier to run tests in one (or many) environments, and then report in another. It has not had much real-world testing, so it may change in incompatible ways in the future. - When constructing a coverage.Coverage object, data_file can be specified as None to prevent writing any data file at all. In previous versions, an explicit data_file=None argument would use the default of “.coverage”. Fixes issue 871.
- Python files run with
-m
now have__spec__
defined properly. This fixes issue 745 (about not being able to run unittest tests that spawn subprocesses), and issue 838, which described the problem directly. - The
[paths]
configuration section is now ordered. If you specify more than one list of patterns, the first one that matches will be used. Fixes issue 649. - The coverage.numbits.register_sqlite_functions() function now also registers numbits_to_nums for use in SQLite queries. Thanks, Simon Willison.
- Python 3.9a1 is supported.
- Coverage.py has a mascot: Sleepy Snake.
coverage-5.0b1
- The HTML and textual reports now have a
--skip-empty
option that skips files with no statements, notably__init__.py
files. Thanks, Reya B. - Configuration can now be read from TOML files. This requires installing coverage.py with the
[toml]
extra. The standard “pyproject.toml” file will be read automatically if no other configuration file is found, with settings in the[tool.coverage.]
namespace. Thanks to Frazer McLean for implementation and persistence. Finishes issue 664. - The
[run] note
setting has been deprecated. Using it will result in a warning, and the note will not be written to the data file. The corresponding CoverageData methods have been removed. - The HTML report has been reimplemented (no more table around the source code). This allowed for a better presentation of the context information, hopefully resolving issue 855.
- Added sqlite3 module version information to
coverage debug sys
output. - Asking the HTML report to show contexts (
[html] show_contexts=True
orcoverage html --show-contexts
) will issue a warning if there were no contexts measured (issue 851).
coverage-5.0a8
- The CoverageData API has changed how queries are limited to specific contexts. Now you use CoverageData.set_query_context() to set a single exact-match string, or CoverageData.set_query_contexts() to set a list of regular expressions to match contexts. This changes the command-line
--contexts
option to use regular expressions instead of filename-style wildcards.
coverage-5.0a7
- Data can now be “reported” in JSON format, for programmatic use, as requested in issue 720. The new
coverage json
command writes raw and summarized data to a JSON file. Thanks, Matt Bachmann. - Dynamic contexts are now supported in the Python tracer, which is important for PyPy users. Closes issue 846.
- The compact line number representation introduced in 5.0a6 is called a “numbits.” The coverage.numbits module provides functions for working with them.
- The reporting methods used to permanently apply their arguments to the configuration of the Coverage object. Now they no longer do. The arguments affect the operation of the method, but do not persist.
- A class named “test_something” no longer confuses the
test_function
dynamic context setting. Fixes issue 829. - Fixed an unusual tokenizing issue with backslashes in comments. Fixes issue 822.
debug=plugin
didn’t properly support configuration or dynamic context plugins, but now it does, closing issue 834.
coverage-5.0a6
- Reporting on contexts. Big thanks to Stephan Richter and Albertas Agejevas for the contribution.
- The
--contexts
option is available on thereport
andhtml
commands. It’s a comma-separated list of shell-style wildcards, selecting the contexts to report on. Only contexts matching one of the wildcards will be included in the report. - The
--show-contexts
option for thehtml
command adds context information to each covered line. Hovering over the “ctx” marker at the end of the line reveals a list of the contexts that covered the line.
- The
- Database changes:
- Line numbers are now stored in a much more compact way. For each file and context, a single binary string is stored with a bit per line number. This greatly improves memory use, but makes ad-hoc use difficult.
- Dynamic contexts with no data are no longer written to the database.
- SQLite data storage is now faster. There’s no longer a reason to keep the JSON data file code, so it has been removed.
- Changes to the CoverageData interface:
- The new CoverageData.dumps() method serializes the data to a string, and a corresponding CoverageData.loads() method reconstitutes this data. The format of the data string is subject to change at any time, and so should only be used between two installations of the same version of coverage.py.
- The CoverageData constructor has a new argument, no_disk (default: False). Setting it to True prevents writing any data to the disk. This is useful for transient data objects.
- Added the classmethod Coverage.current() to get the latest started Coverage instance.
- Multiprocessing support in Python 3.8 was broken, but is now fixed. Closes issue 828.
- Error handling during reporting has changed slightly. All reporting methods now behave the same. The
--ignore-errors
option keeps errors from stopping the reporting, but files that couldn’t parse as Python will always be reported as warnings. As with other warnings, you can suppress them with the[run] disable_warnings
configuration setting. - Coverage.py no longer fails if the user program deletes its current directory. Fixes issue 806. Thanks, Dan Hemberger.
- The scrollbar markers in the HTML report now accurately show the highlighted lines, regardless of what categories of line are highlighted.
- The hack to accommodate ShiningPanda looking for an obsolete internal data file has been removed, since ShiningPanda 0.22 fixed it four years ago.
- The deprecated Reporter.file_reporters property has been removed.
coverage-5.0a5
- Drop support for Python 3.4
- Dynamic contexts can now be set two new ways, both thanks to Justas Sadzevičius.
- A plugin can implement a
dynamic_context
method to check frames for whether a new context should be started. See Dynamic Context Switchers for more details. - Another tool (such as a test runner) can use the new Coverage.switch_context() method to explicitly change the context.
- A plugin can implement a
- The
dynamic_context = test_function
setting now works with Python 2 old-style classes, though it only reports the method name, not the class it was defined on. Closes issue 797. fail_under
values more than 100 are reported as errors. Thanks to Mike Fiedler for closing issue 746.- The “missing” values in the text output are now sorted by line number, so that missing branches are reported near the other lines they affect. The values used to show all missing lines, and then all missing branches.
- Access to the SQLite database used for data storage is now thread-safe. Thanks, Stephan Richter. This closes issue 702.
- Combining data stored in SQLite is now about twice as fast, fixing issue 761. Thanks, Stephan Richter.
- The
filename
attribute on CoverageData objects has been made private. You can use thedata_filename
method to get the actual file name being used to store data, and thebase_filename
method to get the original filename before parallelizing suffixes were added. This is part of fixing issue 708. - Line numbers in the HTML report now align properly with source lines, even when Chrome’s minimum font size is set, fixing issue 748. Thanks Wen Ye.