Namespace packages being measured weren’t properly handled by the new code that ignores third-party packages. If the namespace package was installed, it was ignored as a third-party package. That problem (issue 1231) is now fixed.
Packages named as “source packages” (with source, or source_pkgs, or pytest-cov’s --cov) might have been only partially measured. Their top-level statements could be marked as unexecuted, because they were imported by coverage.py before measurement began (issue 1232). This is now fixed, but the package will be imported twice, once by coverage.py, then again by your test suite. This could cause problems if importing the package has side effects.
In 6.0, the coverage.py exceptions moved from coverage.misc to coverage.exceptions. These exceptions are not part of the public supported API, CoverageException is. But a number of other third-party packages were importing the exceptions from coverage.misc, so they are now available from there again (issue 1226).
Changed an internal detail of how tomli is imported, so that tomli can use coverage.py for their own test suite (issue 1228).
Defend against an obscure possibility under code obfuscation, where a function can have an argument called “self”, but no local named “self” (pull request 1210). Thanks, Ben Carlsson.
6.0
The coverage html command now prints a message indicating where the HTML report was written. Fixes issue 1195.
The coverage combine command now prints messages indicating each data file being combined. Fixes issue 1105.
The HTML report now includes a sentence about skipped files due to skip_covered or skip_empty settings. Fixes issue 1163.
Unrecognized options in the configuration file are no longer errors. They are now warnings, to ease the use of coverage across versions. Fixes issue 1035.
Fix handling of exceptions through context managers in Python 3.10. A missing exception is no longer considered a missing branch from the with statement. Fixes issue 1205.
Fix another rarer instance of “Error binding parameter 0 - probably unsupported type.” (issue 1010).
Creating a directory for the coverage data file now is safer against conflicts when two coverage runs happen simultaneously (pull 1220). Thanks, Clément Pit-Claudel.
6.0b1
Dropped support for Python 2.7, PyPy 2, and Python 3.5.
Added support for the Python 3.10 match/case syntax.
Data collection is now thread-safe. There may have been rare instances of exceptions raised in multi-threaded programs.
Plugins (like the Django coverage plugin) were generating “Already imported a file that will be measured” warnings about Django itself. These have been fixed, closing issue 1150.
Warnings generated by coverage.py are now real Python warnings.
Using --fail-under=100 with coverage near 100% could result in the self-contradictory message total of 100 is less than fail-under=100. This bug (issue 1168) is now fixed.
The COVERAGE_DEBUG_FILE environment variable now accepts stdout and stderr to write to those destinations.
Some minor changes to usually invisible details of the HTML report:
Use a modern hash algorithm when fingerprinting, for high-security environments (issue 1189). When generating the HTML report, we save the hash of the data, to avoid regenerating an unchanged HTML page. We used to use MD5 to generate the hash, and now use SHA-3-256. This was never a security concern, but security scanners would notice the MD5 algorithm and raise a false alarm.
Change how report file names are generated, to avoid leading underscores (issue 1167), to avoid rare file name collisions (issue 584), and to avoid file names becoming too long (issue 580).
coverage-5.6b1
Third-party packages are now ignored in coverage reporting. This solves a few problems:
Coverage will no longer report about other people’s code (issue 876). This is true even when using --source=. with a venv in the current directory.
Coverage will no longer generate “Already imported a file that will be measured” warnings about coverage itself (issue 905).
The HTML report uses j/k to move up and down among the highlighted chunks of code. They used to highlight the current chunk, but 5.0 broke that behavior. Now the highlighting is working again.
The JSON report now includes percent_covered_display, a string with the total percentage, rounded to the same number of decimal places as the other reports’ totals.
Namespace packages being measured weren't properly handled by the new code
that ignores third-party packages. If the namespace package was installed, it
was ignored as a third-party package. That problem (issue 1231_) is now
fixed.
Packages named as "source packages" (with source, or source_pkgs, or
pytest-cov's --cov) might have been only partially measured. Their
top-level statements could be marked as unexecuted, because they were
imported by coverage.py before measurement began (issue 1232_). This is
now fixed, but the package will be imported twice, once by coverage.py, then
again by your test suite. This could cause problems if importing the package
has side effects.
The :meth:.CoverageData.contexts_by_lineno method was documented to return
a dict, but was returning a defaultdict. Now it returns a plain dict. It
also no longer returns negative numbered keys.
In 6.0, the coverage.py exceptions moved from coverage.misc to
coverage.exceptions. These exceptions are not part of the public supported
API, CoverageException is. But a number of other third-party packages were
importing the exceptions from coverage.misc, so they are now available from
there again (issue 1226_).
Changed an internal detail of how tomli is imported, so that tomli can use
coverage.py for their own test suite (issue 1228_).
Defend against an obscure possibility under code obfuscation, where a
function can have an argument called "self", but no local named "self"
(pull request 1210_). Thanks, Ben Carlsson.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps coverage[toml] from 5.5 to 6.0.2.
Release notes
Sourced from coverage[toml]'s releases.
Changelog
Sourced from coverage[toml]'s changelog.
... (truncated)
Commits
a3921d2
build: prep for 6.0.219bb1f8
docs: sample HTML from 6.0.22603597
fix: source modules need to be re-imported. #1232fdaa822
test: add more tests of run_python_filecedd319
build: clean up the Makefile a bitd3f46d2
test: add a test of hash-based pyc filesbcff84f
refactor: remove qualname code that was only for Python 29b54389
fix: make third-party detection work with namespace packages. #123127db7b4
style: the name of the matchers don't need quotes in the reprsa05710e
refactor: remove some left over test printsDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)