Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report failed if \u001d presented in the sources #1512

Closed
romantolkachyov opened this issue Dec 22, 2022 · 4 comments
Closed

Report failed if \u001d presented in the sources #1512

romantolkachyov opened this issue Dec 22, 2022 · 4 comments
Labels
bug Something isn't working fixed html

Comments

@romantolkachyov
Copy link

Describe the bug

Failed to build report if some of the source files contains \u001d unicode character (GS):

Couldn't parse '/opt/app/tests/module_tests.py' as Python source: 'EOF in multi-line statement' at line 3306

And there is no such a line in the file (there is less than 3100 lines at all)

To Reproduce
How can we reproduce the problem? Please be specific. Don't link to a failing CI job. Answer the questions below:

  1. What version of Python are you using?
    Python 3.9.16
  2. What version of coverage.py shows the problem? The output of coverage debug sys is helpful.
    6.5, 7.0
  3. What versions of what packages do you have installed? The output of pip freeze is helpful.
    Private repo, can't do so without modifications so useless
  4. What code shows the problem? Give us a specific commit of a specific repo that we can check out. If you've already worked around the problem, please provide a commit before that fix.
example = "�"
  1. What commands did you run?
python -m coverage run python manage.py test
python -m coverage html

Expected behavior
Report should be generated.

Additional context
Everything else works correctly: tests are passed and pylint check is successful

@romantolkachyov romantolkachyov added bug Something isn't working needs triage labels Dec 22, 2022
@nedbat
Copy link
Owner

nedbat commented Dec 22, 2022

I'm not seeing the same thing you are:

% hexdump -C example.py
00000000  65 78 61 6d 70 6c 65 20  3d 20 22 1d 22 0a        |example = ".".|
0000000e

% coverage run example.py

% coverage html
Wrote HTML report to htmlcov/index.html

Can you create a zip file with the files that are causing the problems for you? I might be doing something wrong.

@nedbat nedbat added question Further information is requested html and removed needs triage labels Dec 22, 2022
@romantolkachyov
Copy link
Author

romantolkachyov commented Dec 23, 2022

@nedbat Sorry it is not enough. Just didn't test example first. This should work:

from unittest import TestCase


class ExampleTest(TestCase):
    def test_example(self):
        test = {
            "identifiers": ["�01099912345612321128033010111111111128�21420127�8"], "mode": "serialize"
        }

Don't know why but any simplification like removing mode key from the dict cause successful report build.

Then

$ coverage run test.py
$ coverage xml
Couldn't parse '/Users/roman/work/mahaon/tmp/test.py' as Python source: 'EOF in multi-line statement' at line 12
$ coverage html
Couldn't parse '/Users/roman/work/mahaon/tmp/test.py' as Python source: 'EOF in multi-line statement' at line 12

hexdump:

$ hexdump -C test.py 
00000000  66 72 6f 6d 20 75 6e 69  74 74 65 73 74 20 69 6d  |from unittest im|
00000010  70 6f 72 74 20 54 65 73  74 43 61 73 65 0a 0a 0a  |port TestCase...|
00000020  63 6c 61 73 73 20 45 78  61 6d 70 6c 65 54 65 73  |class ExampleTes|
00000030  74 28 54 65 73 74 43 61  73 65 29 3a 0a 20 20 20  |t(TestCase):.   |
00000040  20 64 65 66 20 74 65 73  74 5f 65 78 61 6d 70 6c  | def test_exampl|
00000050  65 28 73 65 6c 66 29 3a  0a 20 20 20 20 20 20 20  |e(self):.       |
00000060  20 74 65 73 74 20 3d 20  7b 0a 20 20 20 20 20 20  | test = {.      |
00000070  20 20 20 20 20 20 22 69  64 65 6e 74 69 66 69 65  |      "identifie|
00000080  72 73 22 3a 20 5b 22 1d  30 31 30 39 39 39 31 32  |rs": [".01099912|
00000090  33 34 35 36 31 32 33 32  31 31 32 38 30 33 33 30  |3456123211280330|
000000a0  31 30 31 31 31 31 31 31  31 31 31 31 32 38 1d 32  |10111111111128.2|
000000b0  31 34 32 30 31 32 37 1d  38 22 5d 2c 20 22 6d 6f  |1420127.8"], "mo|
000000c0  64 65 22 3a 20 22 73 65  72 69 61 6c 69 7a 65 22  |de": "serialize"|
000000d0  0a 20 20 20 20 20 20 20  20 7d 0a                 |.        }.|
000000db

test.py.zip

nedbat added a commit that referenced this issue Dec 23, 2022
It turns out that str.splitlines() will break text on some characters
that file.readline() does not!  Use readline() to read source files the
same way that Python does.
nedbat added a commit that referenced this issue Dec 23, 2022
It turns out that str.splitlines() will break text on some characters
that file.readline() does not!  Use readline() to read source files the
same way that Python does.
@nedbat
Copy link
Owner

nedbat commented Dec 23, 2022

Thanks, this is fixed in commit 35e249f.

Note that the HTML report doesn't display these characters well, and differently than GitHub does. That can be a new issue if it needs to be improved.

@nedbat nedbat added fixed and removed question Further information is requested labels Dec 23, 2022
@nedbat nedbat closed this as completed Dec 23, 2022
@nedbat
Copy link
Owner

nedbat commented Dec 23, 2022

This is now released as part of coverage 7.0.1.

RobertCraigie referenced this issue in RobertCraigie/prisma-client-py Feb 1, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [coverage](https://togithub.com/nedbat/coveragepy) | `==6.5.0` ->
`==7.1.0` |
[![age](https://badges.renovateapi.com/packages/pypi/coverage/7.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/coverage/7.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/coverage/7.1.0/compatibility-slim/6.5.0)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/coverage/7.1.0/confidence-slim/6.5.0)](https://docs.renovatebot.com/merge-confidence/)
|
| [mkdocs-material](https://togithub.com/squidfunk/mkdocs-material) |
`==8.5.11` -> `==9.0.9` |
[![age](https://badges.renovateapi.com/packages/pypi/mkdocs-material/9.0.9/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/mkdocs-material/9.0.9/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/mkdocs-material/9.0.9/compatibility-slim/8.5.11)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/mkdocs-material/9.0.9/confidence-slim/8.5.11)](https://docs.renovatebot.com/merge-confidence/)
|
| [mock](http://mock.readthedocs.org/en/latest/)
([source](https://togithub.com/testing-cabal/mock)) | `==4.0.3` ->
`==5.0.1` |
[![age](https://badges.renovateapi.com/packages/pypi/mock/5.0.1/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/mock/5.0.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/mock/5.0.1/compatibility-slim/4.0.3)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/mock/5.0.1/confidence-slim/4.0.3)](https://docs.renovatebot.com/merge-confidence/)
|
| [pre-commit](https://togithub.com/pre-commit/pre-commit) | `==2.21.0`
-> `==3.0.2` |
[![age](https://badges.renovateapi.com/packages/pypi/pre-commit/3.0.2/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/pre-commit/3.0.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/pre-commit/3.0.2/compatibility-slim/2.21.0)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/pre-commit/3.0.2/confidence-slim/2.21.0)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>nedbat/coveragepy</summary>

###
[`v7.1.0`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-710--2023-01-24)

[Compare
Source](https://togithub.com/nedbat/coveragepy/compare/7.0.5...7.1.0)

- Added: the debug output file can now be specified with `[run]
debug_file`
    in the configuration file.  Closes `issue 1319`\_.

- Performance: fixed a slowdown with dynamic contexts that's been around
since
6.4.3. The fix closes `issue 1538`*. Thankfully this doesn't break the
`Cython change`* that fixed `issue 972`\_. Thanks to Mathieu Kniewallner
for
    the deep investigative work and comprehensive issue report.

-   Typing: all product and test code has type annotations.

.. \_Cython
change:[https://github.com/nedbat/coveragepy/pull/1347](https://togithub.com/nedbat/coveragepy/pull/1347)7
.. \_issue
972[https://github.com/nedbat/coveragepy/issues/972](https://togithub.com/nedbat/coveragepy/issues/972)72
.. \_issue
131[https://github.com/nedbat/coveragepy/issues/1319](https://togithub.com/nedbat/coveragepy/issues/1319)319
.. \_issue
15[https://github.com/nedbat/coveragepy/issues/1538](https://togithub.com/nedbat/coveragepy/issues/1538)1538

.. \_changes\_7-0-5:

###
[`v7.0.5`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-705--2023-01-10)

[Compare
Source](https://togithub.com/nedbat/coveragepy/compare/7.0.4...7.0.5)

- Fix: On Python 3.7, a file with type annotations but no `from
__future__
import annotations` would be missing statements in the coverage report.
This
    is now fixed, closing `issue 1524`\_.

.. \_issue
1524:[https://github.com/nedbat/coveragepy/issues/1524](https://togithub.com/nedbat/coveragepy/issues/1524)4

.. \_changes\_7-0-4:

###
[`v7.0.4`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-704--2023-01-07)

[Compare
Source](https://togithub.com/nedbat/coveragepy/compare/7.0.3...7.0.4)

- Performance: an internal cache of file names was accidentally
disabled,
resulting in sometimes drastic reductions in performance. This is now
fixed,
closing `issue 1527`\_. Thanks to Ivan Ciuvalschii for the reproducible
test
    case.

.. \_issue
1527:[https://github.com/nedbat/coveragepy/issues/1527](https://togithub.com/nedbat/coveragepy/issues/1527)7

.. \_changes\_7-0-3:

###
[`v7.0.3`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-703--2023-01-03)

[Compare
Source](https://togithub.com/nedbat/coveragepy/compare/7.0.2...7.0.3)

- Fix: when using pytest-cov or pytest-xdist, or perhaps both, the
combining
step could fail with `assert row is not None` using 7.0.2. This was due
to
a race condition that has always been possible and is still possible. In
7.0.1 and before, the error was silently swallowed by the combining
code.
Now it will produce a message "Couldn't combine data file" and ignore
the
    data file as it used to do before 7.0.2.  Closes `issue 1522`\_.

.. \_issue
1522:[https://github.com/nedbat/coveragepy/issues/1522](https://togithub.com/nedbat/coveragepy/issues/1522)2

.. \_changes\_7-0-2:

###
[`v7.0.2`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-702--2023-01-02)

[Compare
Source](https://togithub.com/nedbat/coveragepy/compare/7.0.1...7.0.2)

- Fix: when using the `[run] relative_files = True` setting, a relative
    `[paths]` pattern was still being made absolute.  This is now fixed,
    closing `issue 1519`\_.

- Fix: if Python doesn't provide tomllib, then TOML configuration files
can
    only be read if coverage.py is installed with the `[toml]` extra.
Coverage.py will raise an error if TOML support is not installed when it
sees
    your settings are in a .toml file. But it didn't understand that
`[tools.coverage]` was a valid section header, so the error wasn't
reported
if you used that header, and settings were silently ignored. This is now
    fixed, closing `issue 1516`\_.

- Fix: adjusted how decorators are traced on PyPy 7.3.10, fixing `issue
1515`\_.

-   Fix: the `coverage lcov` report did not properly implement the
    `--fail-under=MIN` option.  This has been fixed.

- Refactor: added many type annotations, including a number of
refactorings.
This should not affect outward behavior, but they were a bit invasive in
some
    places, so keep your eyes peeled for oddities.

- Refactor: removed the vestigial and long untested support for Jython
and
    IronPython.

.. \_issue
1515:[https://github.com/nedbat/coveragepy/issues/1515](https://togithub.com/nedbat/coveragepy/issues/1515)5
.. \_issue
1516[https://github.com/nedbat/coveragepy/issues/1516](https://togithub.com/nedbat/coveragepy/issues/1516)16
.. \_issue
151[https://github.com/nedbat/coveragepy/issues/1519](https://togithub.com/nedbat/coveragepy/issues/1519)519

.. \_changes\_7-0-1:

###
[`v7.0.1`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-701--2022-12-23)

[Compare
Source](https://togithub.com/nedbat/coveragepy/compare/7.0.0...7.0.1)

- When checking if a file mapping resolved to a file that exists, we
weren't
considering files in .whl files. This is now fixed, closing `issue
1511`\_.

- File pattern rules were too strict, forbidding plus signs and curly
braces in
directory and file names. This is now fixed, closing `issue 1513`\_.

-   Unusual Unicode or control characters in source files could prevent
    reporting.  This is now fixed, closing `issue 1512`\_.

- The PyPy wheel now installs on PyPy 3.7, 3.8, and 3.9, closing `issue
1510`\_.

.. \_issue
1510:[https://github.com/nedbat/coveragepy/issues/1510](https://togithub.com/nedbat/coveragepy/issues/1510)0
.. \_issue
1511[https://github.com/nedbat/coveragepy/issues/1511](https://togithub.com/nedbat/coveragepy/issues/1511)11
.. \_issue
151[https://github.com/nedbat/coveragepy/issues/1512](https://togithub.com/nedbat/coveragepy/issues/1512)512
.. \_issue
15[https://github.com/nedbat/coveragepy/issues/1513](https://togithub.com/nedbat/coveragepy/issues/1513)1513

.. \_changes\_7-0-0:

###
[`v7.0.0`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-700--2022-12-18)

[Compare
Source](https://togithub.com/nedbat/coveragepy/compare/6.5.0...7.0.0)

Nothing new beyond 7.0.0b1.

.. \_changes\_7-0-0b1:

</details>

<details>
<summary>squidfunk/mkdocs-material</summary>

###
[`v9.0.9`](https://togithub.com/squidfunk/mkdocs-material/releases/tag/9.0.9):
mkdocs-material-9.0.9

[Compare
Source](https://togithub.com/squidfunk/mkdocs-material/compare/9.0.8...9.0.9)

-   Updated Bulgarian translations
-   Updated Chinese (Simplified) translations
-   Updated Dutch translations
-   Updated Hindi translations
-   Updated Japanese translations
-   Updated Polish translations

###
[`v9.0.8`](https://togithub.com/squidfunk/mkdocs-material/releases/tag/9.0.8):
mkdocs-material-9.0.8

[Compare
Source](https://togithub.com/squidfunk/mkdocs-material/compare/9.0.7...9.0.8)

-   Updated Croatian translations
-   Updated French translations
-   Updated Hungarian translations
-   Updated Portuguese (Brasilian) translations
-   Updated Spanish translations
-   Updated Ukrainian translations
-   Updated Urdu translations
-   Updated Vietnamese translations

###
[`v9.0.7`](https://togithub.com/squidfunk/mkdocs-material/releases/tag/9.0.7):
mkdocs-material-9.0.7

[Compare
Source](https://togithub.com/squidfunk/mkdocs-material/compare/9.0.6...9.0.7)

-   Improved accessibility of sidebar navigation
-   Moved all translations into community edition
-   Updated Polish and Portuguese (Brasilian) translations
-   Fixed info plugin terminating on subsequent reload when serving
- Fixed
[#&#8203;4910](https://togithub.com/squidfunk/mkdocs-material/issues/4910):
Sidebar navigation labels have invalid ARIA roles
- Fixed
[#&#8203;4884](https://togithub.com/squidfunk/mkdocs-material/issues/4884):
Search query terms can't be separated by colons

###
[`v9.0.6`](https://togithub.com/squidfunk/mkdocs-material/releases/tag/9.0.6):
mkdocs-material-9.0.6

[Compare
Source](https://togithub.com/squidfunk/mkdocs-material/compare/9.0.5...9.0.6)

- Fixed
[#&#8203;4883](https://togithub.com/squidfunk/mkdocs-material/issues/4883):
Automatically disable info plugin when serving
- Fixed
[#&#8203;4885](https://togithub.com/squidfunk/mkdocs-material/issues/4885):
Search plugin crashes in some exotic cases (9.0.3 regression)

###
[`v9.0.5`](https://togithub.com/squidfunk/mkdocs-material/releases/tag/9.0.5):
mkdocs-material-9.0.5

[Compare
Source](https://togithub.com/squidfunk/mkdocs-material/compare/9.0.4...9.0.5)

- Fixed
[#&#8203;4842](https://togithub.com/squidfunk/mkdocs-material/issues/4842):
Improved accessibility of search result list

###
[`v9.0.4`](https://togithub.com/squidfunk/mkdocs-material/releases/tag/9.0.4):
mkdocs-material-9.0.4

[Compare
Source](https://togithub.com/squidfunk/mkdocs-material/compare/9.0.3...9.0.4)

- Fixed
[#&#8203;4823](https://togithub.com/squidfunk/mkdocs-material/issues/4823):
Improved contrast ratio in footer (9.0.2 regression)
- Fixed
[#&#8203;4832](https://togithub.com/squidfunk/mkdocs-material/issues/4832):
Set navigation items back to black (9.0.3 regression)
- Fixed
[#&#8203;4843](https://togithub.com/squidfunk/mkdocs-material/issues/4843):
Emojis broken due to `maxcdn.com` shutting down
-   Upgraded Python Markdown Extensions to 9.9.1

###
[`v9.0.3`](https://togithub.com/squidfunk/mkdocs-material/releases/tag/9.0.3):
mkdocs-material-9.0.3

[Compare
Source](https://togithub.com/squidfunk/mkdocs-material/compare/9.0.2...9.0.3)

-   Improved discernability of section index pages in navigation
-   Improved collapsing of adjacent whitespace in search plugin
-   Updated Indonesian translations
-   Fixed view source of this page button when edit URL points to blob
- Fixed
[#&#8203;4829](https://togithub.com/squidfunk/mkdocs-material/issues/4829):
Search overlay does not close for active anchor result
- Fixed
[#&#8203;4824](https://togithub.com/squidfunk/mkdocs-material/issues/4824):
Search plugin crashes for `h[1-6]` contained in other elements
- Fixed
[#&#8203;4804](https://togithub.com/squidfunk/mkdocs-material/issues/4804):
Nested navigation items not expandable with keyboard
- Fixed
[#&#8203;4689](https://togithub.com/squidfunk/mkdocs-material/issues/4689):
anchor tracking not working for anchors in tables
-   Upgraded to Mermaid 9.3.0

###
[`v9.0.2`](https://togithub.com/squidfunk/mkdocs-material/releases/tag/9.0.2):
mkdocs-material-9.0.2

[Compare
Source](https://togithub.com/squidfunk/mkdocs-material/compare/9.0.1...9.0.2)

- Fixed
[#&#8203;4823](https://togithub.com/squidfunk/mkdocs-material/issues/4823):
Improved contrast ratio in footer to meet WCAG guidelines
- Fixed
[#&#8203;4819](https://togithub.com/squidfunk/mkdocs-material/issues/4819):
Social plugin crashes when card generation is disabled
- Fixed
[#&#8203;4817](https://togithub.com/squidfunk/mkdocs-material/issues/4817):
Search plugin crashes on numeric page titles in `nav`

###
[`v9.0.1`](https://togithub.com/squidfunk/mkdocs-material/releases/tag/9.0.1):
mkdocs-material-9.0.1

[Compare
Source](https://togithub.com/squidfunk/mkdocs-material/compare/9.0.0...9.0.1)

-   Removed `pipdeptree` dependency for built-in info plugin
-   Fixed appearance of linked tags when hovered (9.0.0 regression)
- Fixed
[#&#8203;4810](https://togithub.com/squidfunk/mkdocs-material/issues/4810):
Abbreviations run out of screen on touch devices
- Fixed
[#&#8203;4813](https://togithub.com/squidfunk/mkdocs-material/issues/4813):
View source and edit button links are the same

###
[`v9.0.0`](https://togithub.com/squidfunk/mkdocs-material/releases/tag/9.0.0):
mkdocs-material-9.0.0

[Compare
Source](https://togithub.com/squidfunk/mkdocs-material/compare/8.5.11...9.0.0)

**Additions and improvements**

-   Added support for rich search previews
-   Added support for tokenizer lookahead
-   Added support for better search highlighting
-   Added support for excluding content from search
-   Added support for configurable search pipeline
-   Added support for offline search via offline plugin
-   Added support for multiple instances of built-in tags plugin
-   Added support for removing copy-to-clipboard button
-   Added support for removing footer navigation
-   Added support for button to view the source of a page
-   Improved readability of query string for search sharing
-   Improved stability of search plugin when using `--dirtyreload`
-   Improved search result group button, now sticky and stable
-   Updated Norwegian translations
-   Updated MkDocs to 1.4.2

**Removals**

-   Removed deprecated alternative admonition qualifiers
-   Removed `:is()` selectors (in output) for easier overriding
-   Removed `.title` suffix on translations
-   Removed legacy method for providing page title in feedback URL
-   Removed support for indexing only titles in search
-   Removed support for custom search transforms
-   Removed support for custom search workers
-   Removed temporary snow feature (easter egg)

**Fixes**

-   Fixed Norwegian and Korean language code
-   Fixed detection of composition events in search interface
-   Fixed search plugin not using title set via front matter
-   Fixed search highlighting of tags
-   Fixed search sharing URL using post transformed string
-   Fixed theme-color meta tag getting out-of-sync with palette toggle
-   Fixed prev/next page keyboard navigation when footer is not present
-   Fixed overflowing navigation tabs not being scrollable
-   Fixed inclusion of code block line numbers from search

</details>

<details>
<summary>testing-cabal/mock</summary>

###
[`v5.0.1`](https://togithub.com/testing-cabal/mock/blob/HEAD/CHANGELOG.rst#&#8203;501)

[Compare
Source](https://togithub.com/testing-cabal/mock/compare/5.0.0...5.0.1)

- [gh-100740](https://togithub.com/testing-cabal/mock/issues/100740):
Fix `unittest.mock.Mock` not respecting the spec for
    attribute names prefixed with `assert`.

- [gh-100690](https://togithub.com/testing-cabal/mock/issues/100690):
`Mock` objects which are not unsafe will now raise an
`AttributeError` when accessing an attribute that matches the name of an
    assertion but without the prefix `assert_`, e.g. accessing
`called_once` instead of `assert_called_once`. This is in addition to
this already happening for accessing attributes with prefixes `assert`,
    `assret`, `asert`, `aseert`, and `assrt`.

- [gh-96127](https://togithub.com/testing-cabal/mock/issues/96127):
`inspect.signature` was raising `TypeError` on call with
mock objects. Now it correctly returns `(*args, **kwargs)` as infered
    signature.

###
[`v5.0.0`](https://togithub.com/testing-cabal/mock/blob/HEAD/CHANGELOG.rst#&#8203;500)

[Compare
Source](https://togithub.com/testing-cabal/mock/compare/4.0.3...5.0.0)

- [gh-98624](https://togithub.com/testing-cabal/mock/issues/98624): Add
a mutex to unittest.mock.NonCallableMock to protect
    concurrent access to mock attributes.

- bpo-43478: Mocks can no longer be used as the specs for other Mocks.
As a
result, an already-mocked object cannot have an attribute mocked using
`autospec=True` or be the subject of a `create_autospec(...)` call. This
can uncover bugs in tests since these Mock-derived Mocks will always
pass
    certain tests (e.g. isinstance) and builtin assert functions (e.g.
    assert_called_once_with) will unconditionally pass.

- bpo-45156: Fixes infinite loop on :func:`unittest.mock.seal` of mocks
    created by :func:`~unittest.create_autospec`.

-   bpo-41403: Make :meth:`mock.patch` raise a :exc:`TypeError` with a
relevant error message on invalid arg. Previously it allowed a cryptic
    :exc:`AttributeError` to escape.

- [gh-91803](https://togithub.com/testing-cabal/mock/issues/91803): Fix
an error when using a method of objects mocked with
    :func:`unittest.mock.create_autospec` after it was sealed with
    :func:`unittest.mock.seal` function.

- bpo-41877: AttributeError for suspected misspellings of assertions on
mocks are now pointing out that the cause are misspelled assertions and
also what to do if the misspelling is actually an intended attribute
name.
The unittest.mock document is also updated to reflect the current set of
    recognised misspellings.

- bpo-43478: Mocks can no longer be provided as the specs for other
Mocks.
As a result, an already-mocked object cannot be passed to `mock.Mock()`.
This can uncover bugs in tests since these Mock-derived Mocks will
always
pass certain tests (e.g. isinstance) and builtin assert functions (e.g.
    assert_called_once_with) will unconditionally pass.

-   bpo-45010: Remove support of special method `__div__` in
    :mod:`unittest.mock`. It is not used in Python 3.

- [gh-84753](https://togithub.com/testing-cabal/mock/issues/84753):
:func:`inspect.iscoroutinefunction` now properly returns
`True` when an instance of :class:`unittest.mock.AsyncMock` is passed to
    it.  This makes it consistent with behavior of
    :func:`asyncio.iscoroutinefunction`.  Patch by Mehdi ABAAKOUK.

-   bpo-46852: Remove the undocumented private `float.__set_format__()`
method, previously known as `float.__setformat__()` in Python 3.7. Its
docstring said: "You probably don't want to use this function. It exists
    mainly to be used in Python's test suite." Patch by Victor Stinner.

- [gh-98086](https://togithub.com/testing-cabal/mock/issues/98086): Make
sure `patch.dict()` can be applied on async functions.

- [gh-100287](https://togithub.com/testing-cabal/mock/issues/100287):
Fix the interaction of :func:`unittest.mock.seal` with
    :class:`unittest.mock.AsyncMock`.

- [gh-83076](https://togithub.com/testing-cabal/mock/issues/83076):
Instantiation of `Mock()` and `AsyncMock()` is now 3.8x
    faster.

- bpo-41877: A check is added against misspellings of autospect,
auto_spec
    and set_spec being passed as arguments to patch, patch.object and
    create_autospec.

</details>

<details>
<summary>pre-commit/pre-commit</summary>

###
[`v3.0.2`](https://togithub.com/pre-commit/pre-commit/blob/HEAD/CHANGELOG.md#&#8203;302---2023-01-29)

[Compare
Source](https://togithub.com/pre-commit/pre-commit/compare/v3.0.1...v3.0.2)

\==================

##### Fixes

-   Prevent local `Gemfile` from interfering with hook execution.
- [#&#8203;2727](https://togithub.com/pre-commit/pre-commit/issues/2727)
PR by [@&#8203;asottile](https://togithub.com/asottile).
-   Fix `language: r`, `repo: local` hooks
-
[pre-commit-ci/issues#&#8203;107](https://togithub.com/pre-commit-ci/issues/issues/107)
by [@&#8203;lorenzwalthert](https://togithub.com/lorenzwalthert).
- [#&#8203;2728](https://togithub.com/pre-commit/pre-commit/issues/2728)
PR by [@&#8203;asottile](https://togithub.com/asottile).

###
[`v3.0.1`](https://togithub.com/pre-commit/pre-commit/blob/HEAD/CHANGELOG.md#&#8203;301---2023-01-26)

[Compare
Source](https://togithub.com/pre-commit/pre-commit/compare/v3.0.0...v3.0.1)

\==================

##### Fixes

-   Ensure coursier hooks are available offline after install.
- [#&#8203;2723](https://togithub.com/pre-commit/pre-commit/issues/2723)
PR by [@&#8203;asottile](https://togithub.com/asottile).

###
[`v3.0.0`](https://togithub.com/pre-commit/pre-commit/blob/HEAD/CHANGELOG.md#&#8203;300---2023-01-23)

[Compare
Source](https://togithub.com/pre-commit/pre-commit/compare/v2.21.0...v3.0.0)

\==================

##### Features

-   Make `language: golang` bootstrap `go` if not present.
- [#&#8203;2651](https://togithub.com/pre-commit/pre-commit/issues/2651)
PR by [@&#8203;taoufik07](https://togithub.com/taoufik07).
- [#&#8203;2649](https://togithub.com/pre-commit/pre-commit/issues/2649)
issue by [@&#8203;taoufik07](https://togithub.com/taoufik07).
- `language: coursier` now supports `additional_dependencies` and `repo:
local`
- [#&#8203;2702](https://togithub.com/pre-commit/pre-commit/issues/2702)
PR by [@&#8203;asottile](https://togithub.com/asottile).
-   Upgrade `ruby-build` to `20221225`.
- [#&#8203;2718](https://togithub.com/pre-commit/pre-commit/issues/2718)
PR by [@&#8203;jalessio](https://togithub.com/jalessio).

##### Fixes

-   Improve error message for invalid yaml for `pre-commit autoupdate`.
- [#&#8203;2686](https://togithub.com/pre-commit/pre-commit/issues/2686)
PR by [@&#8203;asottile](https://togithub.com/asottile).
- [#&#8203;2685](https://togithub.com/pre-commit/pre-commit/issues/2685)
issue by
[@&#8203;CarstenGrohmann](https://togithub.com/CarstenGrohmann).
-   `repo: local` no longer provisions an empty `git` repo.
- [#&#8203;2699](https://togithub.com/pre-commit/pre-commit/issues/2699)
PR by [@&#8203;asottile](https://togithub.com/asottile).

##### Updating

-   Drop support for python<3.8
- [#&#8203;2655](https://togithub.com/pre-commit/pre-commit/issues/2655)
PR by [@&#8203;asottile](https://togithub.com/asottile).
- Drop support for top-level list, use `pre-commit migrate-config` to
update.
- [#&#8203;2656](https://togithub.com/pre-commit/pre-commit/issues/2656)
PR by [@&#8203;asottile](https://togithub.com/asottile).
- Drop support for `sha` to specify revision, use `pre-commit
migrate-config`
    to update.
- [#&#8203;2657](https://togithub.com/pre-commit/pre-commit/issues/2657)
PR by [@&#8203;asottile](https://togithub.com/asottile).
- Remove `pre-commit-validate-config` and
`pre-commit-validate-manifest`, use
`pre-commit validate-config` and `pre-commit validate-manifest` instead.
- [#&#8203;2658](https://togithub.com/pre-commit/pre-commit/issues/2658)
PR by [@&#8203;asottile](https://togithub.com/asottile).
-   `language: golang` hooks must use `go.mod` to specify dependencies
- [#&#8203;2672](https://togithub.com/pre-commit/pre-commit/issues/2672)
PR by [@&#8203;taoufik07](https://togithub.com/taoufik07).

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/RobertCraigie/prisma-client-py).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC42Mi4xIiwidXBkYXRlZEluVmVyIjoiMzQuMTE5LjAifQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Robert Craigie <[email protected]>
allenporter referenced this issue in allenporter/flux-local Feb 6, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [coverage](https://togithub.com/nedbat/coveragepy) | `==6.4.2` ->
`==7.1.0` |
[![age](https://badges.renovateapi.com/packages/pypi/coverage/7.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/coverage/7.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/coverage/7.1.0/compatibility-slim/6.4.2)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/coverage/7.1.0/confidence-slim/6.4.2)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>nedbat/coveragepy</summary>

###
[`v7.1.0`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-710--2023-01-24)

[Compare
Source](https://togithub.com/nedbat/coveragepy/compare/7.0.5...7.1.0)

- Added: the debug output file can now be specified with `[run]
debug_file`
    in the configuration file.  Closes `issue 1319`\_.

- Performance: fixed a slowdown with dynamic contexts that's been around
since
6.4.3. The fix closes `issue 1538`*. Thankfully this doesn't break the
`Cython change`* that fixed `issue 972`\_. Thanks to Mathieu Kniewallner
for
    the deep investigative work and comprehensive issue report.

-   Typing: all product and test code has type annotations.

.. \_Cython
change:[https://github.com/nedbat/coveragepy/pull/1347](https://togithub.com/nedbat/coveragepy/pull/1347)7
.. \_issue
972[https://github.com/nedbat/coveragepy/issues/972](https://togithub.com/nedbat/coveragepy/issues/972)72
.. \_issue
131[https://github.com/nedbat/coveragepy/issues/1319](https://togithub.com/nedbat/coveragepy/issues/1319)319
.. \_issue
15[https://github.com/nedbat/coveragepy/issues/1538](https://togithub.com/nedbat/coveragepy/issues/1538)1538

.. \_changes\_7-0-5:

###
[`v7.0.5`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-705--2023-01-10)

[Compare
Source](https://togithub.com/nedbat/coveragepy/compare/7.0.4...7.0.5)

- Fix: On Python 3.7, a file with type annotations but no `from
__future__
import annotations` would be missing statements in the coverage report.
This
    is now fixed, closing `issue 1524`\_.

.. \_issue
1524:[https://github.com/nedbat/coveragepy/issues/1524](https://togithub.com/nedbat/coveragepy/issues/1524)4

.. \_changes\_7-0-4:

###
[`v7.0.4`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-704--2023-01-07)

[Compare
Source](https://togithub.com/nedbat/coveragepy/compare/7.0.3...7.0.4)

- Performance: an internal cache of file names was accidentally
disabled,
resulting in sometimes drastic reductions in performance. This is now
fixed,
closing `issue 1527`\_. Thanks to Ivan Ciuvalschii for the reproducible
test
    case.

.. \_issue
1527:[https://github.com/nedbat/coveragepy/issues/1527](https://togithub.com/nedbat/coveragepy/issues/1527)7

.. \_changes\_7-0-3:

###
[`v7.0.3`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-703--2023-01-03)

[Compare
Source](https://togithub.com/nedbat/coveragepy/compare/7.0.2...7.0.3)

- Fix: when using pytest-cov or pytest-xdist, or perhaps both, the
combining
step could fail with `assert row is not None` using 7.0.2. This was due
to
a race condition that has always been possible and is still possible. In
7.0.1 and before, the error was silently swallowed by the combining
code.
Now it will produce a message "Couldn't combine data file" and ignore
the
    data file as it used to do before 7.0.2.  Closes `issue 1522`\_.

.. \_issue
1522:[https://github.com/nedbat/coveragepy/issues/1522](https://togithub.com/nedbat/coveragepy/issues/1522)2

.. \_changes\_7-0-2:

###
[`v7.0.2`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-702--2023-01-02)

[Compare
Source](https://togithub.com/nedbat/coveragepy/compare/7.0.1...7.0.2)

- Fix: when using the `[run] relative_files = True` setting, a relative
    `[paths]` pattern was still being made absolute.  This is now fixed,
    closing `issue 1519`\_.

- Fix: if Python doesn't provide tomllib, then TOML configuration files
can
    only be read if coverage.py is installed with the `[toml]` extra.
Coverage.py will raise an error if TOML support is not installed when it
sees
    your settings are in a .toml file. But it didn't understand that
`[tools.coverage]` was a valid section header, so the error wasn't
reported
if you used that header, and settings were silently ignored. This is now
    fixed, closing `issue 1516`\_.

- Fix: adjusted how decorators are traced on PyPy 7.3.10, fixing `issue
1515`\_.

-   Fix: the `coverage lcov` report did not properly implement the
    `--fail-under=MIN` option.  This has been fixed.

- Refactor: added many type annotations, including a number of
refactorings.
This should not affect outward behavior, but they were a bit invasive in
some
    places, so keep your eyes peeled for oddities.

- Refactor: removed the vestigial and long untested support for Jython
and
    IronPython.

.. \_issue
1515:[https://github.com/nedbat/coveragepy/issues/1515](https://togithub.com/nedbat/coveragepy/issues/1515)5
.. \_issue
1516[https://github.com/nedbat/coveragepy/issues/1516](https://togithub.com/nedbat/coveragepy/issues/1516)16
.. \_issue
151[https://github.com/nedbat/coveragepy/issues/1519](https://togithub.com/nedbat/coveragepy/issues/1519)519

.. \_changes\_7-0-1:

###
[`v7.0.1`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-701--2022-12-23)

[Compare
Source](https://togithub.com/nedbat/coveragepy/compare/7.0.0...7.0.1)

- When checking if a file mapping resolved to a file that exists, we
weren't
considering files in .whl files. This is now fixed, closing `issue
1511`\_.

- File pattern rules were too strict, forbidding plus signs and curly
braces in
directory and file names. This is now fixed, closing `issue 1513`\_.

-   Unusual Unicode or control characters in source files could prevent
    reporting.  This is now fixed, closing `issue 1512`\_.

- The PyPy wheel now installs on PyPy 3.7, 3.8, and 3.9, closing `issue
1510`\_.

.. \_issue
1510:[https://github.com/nedbat/coveragepy/issues/1510](https://togithub.com/nedbat/coveragepy/issues/1510)0
.. \_issue
1511[https://github.com/nedbat/coveragepy/issues/1511](https://togithub.com/nedbat/coveragepy/issues/1511)11
.. \_issue
151[https://github.com/nedbat/coveragepy/issues/1512](https://togithub.com/nedbat/coveragepy/issues/1512)512
.. \_issue
15[https://github.com/nedbat/coveragepy/issues/1513](https://togithub.com/nedbat/coveragepy/issues/1513)1513

.. \_changes\_7-0-0:

###
[`v7.0.0`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-700--2022-12-18)

[Compare
Source](https://togithub.com/nedbat/coveragepy/compare/6.5.0...7.0.0)

Nothing new beyond 7.0.0b1.

.. \_changes\_7-0-0b1:

###
[`v6.5.0`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-650--2022-09-29)

[Compare
Source](https://togithub.com/nedbat/coveragepy/compare/6.4.4...6.5.0)

- The JSON report now includes details of which branches were taken, and
which
are missing for each file. Thanks, `Christoph Blessing <pull 1438_>`*.
Closes
    `issue 1425`*.

- Starting with coverage.py 6.2, `class` statements were marked as a
branch.
This wasn't right, and has been reverted, fixing `issue 1449`\_. Note
this
will very slightly reduce your coverage total if you are measuring
branch
    coverage.

-   Packaging is now compliant with `PEP 517`*, closing `issue 1395`*.

- A new debug option `--debug=pathmap` shows details of the remapping of
    paths that happens during combine due to the `[paths]` setting.

- Fix an internal problem with caching of invalid Python parsing. Found
by
    OSS-Fuzz, fixing their `bug 50381`\_.

.. \_bug 50381:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50381
.. \_PEP 517: https://peps.python.org/pep-0517/
.. \_issue
139[https://github.com/nedbat/coveragepy/issues/1395](https://togithub.com/nedbat/coveragepy/issues/1395)395
.. \_issue
14[https://github.com/nedbat/coveragepy/issues/1425](https://togithub.com/nedbat/coveragepy/issues/1425)1425
.. \_issue
1[https://github.com/nedbat/coveragepy/issues/1449](https://togithub.com/nedbat/coveragepy/issues/1449)/1449
.. \_pull
[https://github.com/nedbat/coveragepy/pull/1438](https://togithub.com/nedbat/coveragepy/pull/1438)l/1438

.. \_changes\_6-4-4:

###
[`v6.4.4`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-644--2022-08-16)

[Compare
Source](https://togithub.com/nedbat/coveragepy/compare/6.4.3...6.4.4)

-   Wheels are now provided for Python 3.11.

.. \_changes\_6-4-3:

###
[`v6.4.3`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-643--2022-08-06)

[Compare
Source](https://togithub.com/nedbat/coveragepy/compare/6.4.2...6.4.3)

- Fix a failure when combining data files if the file names contained
glob-like
patterns. Thanks, `Michael Krebs and Benjamin Schubert <pull 1405_>`\_.

- Fix a messaging failure when combining Windows data files on a
different
drive than the current directory, closing `issue 1428`*. Thanks,
`Lorenzo
    Micò <pull 1430_>`*.

- Fix path calculations when running in the root directory, as you might
do in
    a Docker container. Thanks `Arthur Rio <pull 1403_>`\_.

- Filtering in the HTML report wouldn't work when reloading the index
page.
    This is now fixed.  Thanks, `Marc Legendre <pull 1413_>`\_.

- Fix a problem with Cython code measurement, closing `issue 972`*.
Thanks,
    `Matus Valo <pull 1347_>`*.

.. \_issue
972:[https://github.com/nedbat/coveragepy/issues/972](https://togithub.com/nedbat/coveragepy/issues/972)2
.. \_issue
1428[https://github.com/nedbat/coveragepy/issues/1428](https://togithub.com/nedbat/coveragepy/issues/1428)28
.. \_pull
134[https://github.com/nedbat/coveragepy/pull/1347](https://togithub.com/nedbat/coveragepy/pull/1347)347
.. \_pull
14[https://github.com/nedbat/coveragepy/issues/1403](https://togithub.com/nedbat/coveragepy/issues/1403)1403
.. \_pull
1[https://github.com/nedbat/coveragepy/issues/1405](https://togithub.com/nedbat/coveragepy/issues/1405)/1405
.. \_pull
[https://github.com/nedbat/coveragepy/issues/1413](https://togithub.com/nedbat/coveragepy/issues/1413)s/1413
..
\_pull[https://github.com/nedbat/coveragepy/pull/1430](https://togithub.com/nedbat/coveragepy/pull/1430)ll/1430

.. \_changes\_6-4-2:

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/allenporter/flux-local).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xMjQuMiIsInVwZGF0ZWRJblZlciI6IjM0LjEyNC4yIn0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue May 5, 2023
Version 7.2.5 — 2023-04-30
--------------------------

- Fix: ``html_report()`` could fail with an AttributeError on ``isatty`` if run
  in an unusual environment where sys.stdout had been replaced.  This is now
  fixed.


Version 7.2.4 — 2023-04-28
--------------------------

PyCon 2023 sprint fixes!

- Fix: with ``relative_files = true``, specifying a specific file to include or
  omit wouldn't work correctly (`issue 1604`_).  This is now fixed, with
  testing help by `Marc Gibbons <pull 1608_>`_.

- Fix: the XML report would have an incorrect ``<source>`` element when using
  relative files and the source option ended with a slash (`issue 1541`_).
  This is now fixed, thanks to `Kevin Brown-Silva <pull 1608_>`_.

- When the HTML report location is printed to the terminal, it's now a
  terminal-compatible URL, so that you can click the location to open the HTML
  file in your browser.  Finishes `issue 1523`_ thanks to `Ricardo Newbery
  <pull 1613_>`_.

- Docs: a new :ref:`Migrating page <migrating>` with details about how to
  migrate between major versions of coverage.py.  It currently covers the
  wildcard changes in 7.x.  Thanks, `Brian Grohe <pull 1610_>`_.

.. _issue 1523: nedbat/coveragepy#1523
.. _issue 1541: nedbat/coveragepy#1541
.. _issue 1604: nedbat/coveragepy#1604
.. _pull 1608: nedbat/coveragepy#1608
.. _pull 1609: nedbat/coveragepy#1609
.. _pull 1610: nedbat/coveragepy#1610
.. _pull 1613: nedbat/coveragepy#1613


Version 7.2.3 — 2023-04-06
--------------------------

- Fix: the :ref:`config_run_sigterm` setting was meant to capture data if a
  process was terminated with a SIGTERM signal, but it didn't always.  This was
  fixed thanks to `Lewis Gaul <pull 1600_>`_, closing `issue 1599`_.

- Performance: HTML reports with context information are now much more compact.
  File sizes are typically as small as one-third the previous size, but can be
  dramatically smaller. This closes `issue 1584`_ thanks to `Oleh Krehel
  <pull 1587_>`_.

- Development dependencies no longer use hashed pins, closing `issue 1592`_.

.. _issue 1584: nedbat/coveragepy#1584
.. _pull 1587: nedbat/coveragepy#1587
.. _issue 1592: nedbat/coveragepy#1592
.. _issue 1599: nedbat/coveragepy#1599
.. _pull 1600: nedbat/coveragepy#1600


Version 7.2.2 — 2023-03-16
--------------------------

- Fix: if a virtualenv was created inside a source directory, and a sourced
  package was installed inside the virtualenv, then all of the third-party
  packages inside the virtualenv would be measured.  This was incorrect, but
  has now been fixed: only the specified packages will be measured, thanks to
  `Manuel Jacob <pull 1560_>`_.

- Fix: the ``coverage lcov`` command could create a .lcov file with incorrect
  LF (lines found) and LH (lines hit) totals.  This is now fixed, thanks to
  `Ian Moore <pull 1583_>`_.

- Fix: the ``coverage xml`` command on Windows could create a .xml file with
  duplicate ``<package>`` elements. This is now fixed, thanks to `Benjamin
  Parzella <pull 1574_>`_, closing `issue 1573`_.

.. _pull 1560: nedbat/coveragepy#1560
.. _issue 1573: nedbat/coveragepy#1573
.. _pull 1574: nedbat/coveragepy#1574
.. _pull 1583: nedbat/coveragepy#1583


Version 7.2.1 — 2023-02-26
--------------------------

- Fix: the PyPI page had broken links to documentation pages, but no longer
  does, closing `issue 1566`_.

- Fix: public members of the coverage module are now properly indicated so that
  mypy will find them, fixing `issue 1564`_.

.. _issue 1564: nedbat/coveragepy#1564
.. _issue 1566: nedbat/coveragepy#1566


Version 7.2.0 — 2023-02-22
--------------------------

- Added a new setting ``[report] exclude_also`` to let you add more exclusions
  without overwriting the defaults.  Thanks, `Alpha Chen <pull 1557_>`_,
  closing `issue 1391`_.

- Added a :meth:`.CoverageData.purge_files` method to remove recorded data for
  a particular file.  Contributed by `Stephan Deibel <pull 1547_>`_.

- Fix: when reporting commands fail, they will no longer congratulate
  themselves with messages like "Wrote XML report to file.xml" before spewing a
  traceback about their failure.

- Fix: arguments in the public API that name file paths now accept pathlib.Path
  objects.  This includes the ``data_file`` and ``config_file`` arguments to
  the Coverage constructor and the ``basename`` argument to CoverageData.
  Closes `issue 1552`_.

- Fix: In some embedded environments, an IndexError could occur on stop() when
  the originating thread exits before completion.  This is now fixed, thanks to
  `Russell Keith-Magee <pull 1543_>`_, closing `issue 1542`_.

- Added a ``py.typed`` file to announce our type-hintedness.  Thanks,
  `KotlinIsland <pull 1550_>`_.

.. _issue 1391: nedbat/coveragepy#1391
.. _issue 1542: nedbat/coveragepy#1542
.. _pull 1543: nedbat/coveragepy#1543
.. _pull 1547: nedbat/coveragepy#1547
.. _pull 1550: nedbat/coveragepy#1550
.. _issue 1552: nedbat/coveragepy#1552
.. _pull 1557: nedbat/coveragepy#1557


Version 7.1.0 — 2023-01-24
--------------------------

- Added: the debug output file can now be specified with ``[run] debug_file``
  in the configuration file.  Closes `issue 1319`_.

- Performance: fixed a slowdown with dynamic contexts that's been around since
  6.4.3.  The fix closes `issue 1538`_.  Thankfully this doesn't break the
  `Cython change`_ that fixed `issue 972`_.  Thanks to Mathieu Kniewallner for
  the deep investigative work and comprehensive issue report.

- Typing: all product and test code has type annotations.

.. _Cython change: nedbat/coveragepy#1347
.. _issue 972: nedbat/coveragepy#972
.. _issue 1319: nedbat/coveragepy#1319
.. _issue 1538: nedbat/coveragepy#1538

Version 7.0.5 — 2023-01-10
--------------------------

- Fix: On Python 3.7, a file with type annotations but no ``from __future__
  import annotations`` would be missing statements in the coverage report. This
  is now fixed, closing `issue 1524`_.

.. _issue 1524: nedbat/coveragepy#1524


Version 7.0.4 — 2023-01-07
--------------------------

- Performance: an internal cache of file names was accidentally disabled,
  resulting in sometimes drastic reductions in performance.  This is now fixed,
  closing `issue 1527`_.   Thanks to Ivan Ciuvalschii for the reproducible test
  case.

.. _issue 1527: nedbat/coveragepy#1527


Version 7.0.3 — 2023-01-03
--------------------------

- Fix: when using pytest-cov or pytest-xdist, or perhaps both, the combining
  step could fail with ``assert row is not None`` using 7.0.2.  This was due to
  a race condition that has always been possible and is still possible. In
  7.0.1 and before, the error was silently swallowed by the combining code.
  Now it will produce a message "Couldn't combine data file" and ignore the
  data file as it used to do before 7.0.2.  Closes `issue 1522`_.

.. _issue 1522: nedbat/coveragepy#1522


Version 7.0.2 — 2023-01-02
--------------------------

- Fix: when using the ``[run] relative_files = True`` setting, a relative
  ``[paths]`` pattern was still being made absolute.  This is now fixed,
  closing `issue 1519`_.

- Fix: if Python doesn't provide tomllib, then TOML configuration files can
  only be read if coverage.py is installed with the ``[toml]`` extra.
  Coverage.py will raise an error if TOML support is not installed when it sees
  your settings are in a .toml file. But it didn't understand that
  ``[tools.coverage]`` was a valid section header, so the error wasn't reported
  if you used that header, and settings were silently ignored.  This is now
  fixed, closing `issue 1516`_.

- Fix: adjusted how decorators are traced on PyPy 7.3.10, fixing `issue 1515`_.

- Fix: the ``coverage lcov`` report did not properly implement the
  ``--fail-under=MIN`` option.  This has been fixed.

- Refactor: added many type annotations, including a number of refactorings.
  This should not affect outward behavior, but they were a bit invasive in some
  places, so keep your eyes peeled for oddities.

- Refactor: removed the vestigial and long untested support for Jython and
  IronPython.

.. _issue 1515: nedbat/coveragepy#1515
.. _issue 1516: nedbat/coveragepy#1516
.. _issue 1519: nedbat/coveragepy#1519


Version 7.0.1 — 2022-12-23
--------------------------

- When checking if a file mapping resolved to a file that exists, we weren't
  considering files in .whl files.  This is now fixed, closing `issue 1511`_.

- File pattern rules were too strict, forbidding plus signs and curly braces in
  directory and file names.  This is now fixed, closing `issue 1513`_.

- Unusual Unicode or control characters in source files could prevent
  reporting.  This is now fixed, closing `issue 1512`_.

- The PyPy wheel now installs on PyPy 3.7, 3.8, and 3.9, closing `issue 1510`_.

.. _issue 1510: nedbat/coveragepy#1510
.. _issue 1511: nedbat/coveragepy#1511
.. _issue 1512: nedbat/coveragepy#1512
.. _issue 1513: nedbat/coveragepy#1513


Version 7.0.0 — 2022-12-18
--------------------------

Nothing new beyond 7.0.0b1.


Version 7.0.0b1 — 2022-12-03
----------------------------

A number of changes have been made to file path handling, including pattern
matching and path remapping with the ``[paths]`` setting (see
:ref:`config_paths`).  These changes might affect you, and require you to
update your settings.

(This release includes the changes from `6.6.0b1 <changes_6-6-0b1_>`_, since
6.6.0 was never released.)

- Changes to file pattern matching, which might require updating your
  configuration:

  - Previously, ``*`` would incorrectly match directory separators, making
    precise matching difficult.  This is now fixed, closing `issue 1407`_.

  - Now ``**`` matches any number of nested directories, including none.

- Improvements to combining data files when using the
  :ref:`config_run_relative_files` setting, which might require updating your
  configuration:

  - During ``coverage combine``, relative file paths are implicitly combined
    without needing a ``[paths]`` configuration setting.  This also fixed
    `issue 991`_.

  - A ``[paths]`` setting like ``*/foo`` will now match ``foo/bar.py`` so that
    relative file paths can be combined more easily.

  - The :ref:`config_run_relative_files` setting is properly interpreted in
    more places, fixing `issue 1280`_.

- When remapping file paths with ``[paths]``, a path will be remapped only if
  the resulting path exists.  The documentation has long said the prefix had to
  exist, but it was never enforced.  This fixes `issue 608`_, improves `issue
  649`_, and closes `issue 757`_.

- Reporting operations now implicitly use the ``[paths]`` setting to remap file
  paths within a single data file.  Combining multiple files still requires the
  ``coverage combine`` step, but this simplifies some single-file situations.
  Closes `issue 1212`_ and `issue 713`_.

- The ``coverage report`` command now has a ``--format=`` option.  The original
  style is now ``--format=text``, and is the default.

  - Using ``--format=markdown`` will write the table in Markdown format, thanks
    to `Steve Oswald <pull 1479_>`_, closing `issue 1418`_.

  - Using ``--format=total`` will write a single total number to the
    output.  This can be useful for making badges or writing status updates.

- Combining data files with ``coverage combine`` now hashes the data files to
  skip files that add no new information.  This can reduce the time needed.
  Many details affect the speed-up, but for coverage.py's own test suite,
  combining is about 40% faster. Closes `issue 1483`_.

- When searching for completely un-executed files, coverage.py uses the
  presence of ``__init__.py`` files to determine which directories have source
  that could have been imported.  However, `implicit namespace packages`_ don't
  require ``__init__.py``.  A new setting ``[report]
  include_namespace_packages`` tells coverage.py to consider these directories
  during reporting.  Thanks to `Felix Horvat <pull 1387_>`_ for the
  contribution.  Closes `issue 1383`_ and `issue 1024`_.

- Fixed environment variable expansion in pyproject.toml files.  It was overly
  broad, causing errors outside of coverage.py settings, as described in `issue
  1481`_ and `issue 1345`_.  This is now fixed, but in rare cases will require
  changing your pyproject.toml to quote non-string values that use environment
  substitution.

- An empty file has a coverage total of 100%, but used to fail with
  ``--fail-under``.  This has been fixed, closing `issue 1470`_.

- The text report table no longer writes out two separator lines if there are
  no files listed in the table.  One is plenty.

- Fixed a mis-measurement of a strange use of wildcard alternatives in
  match/case statements, closing `issue 1421`_.

- Fixed internal logic that prevented coverage.py from running on
  implementations other than CPython or PyPy (`issue 1474`_).

- The deprecated ``[run] note`` setting has been completely removed.

.. _implicit namespace packages: https://peps.python.org/pep-0420/
.. _issue 608: nedbat/coveragepy#608
.. _issue 649: nedbat/coveragepy#649
.. _issue 713: nedbat/coveragepy#713
.. _issue 757: nedbat/coveragepy#757
.. _issue 991: nedbat/coveragepy#991
.. _issue 1024: nedbat/coveragepy#1024
.. _issue 1212: nedbat/coveragepy#1212
.. _issue 1280: nedbat/coveragepy#1280
.. _issue 1345: nedbat/coveragepy#1345
.. _issue 1383: nedbat/coveragepy#1383
.. _issue 1407: nedbat/coveragepy#1407
.. _issue 1418: nedbat/coveragepy#1418
.. _issue 1421: nedbat/coveragepy#1421
.. _issue 1470: nedbat/coveragepy#1470
.. _issue 1474: nedbat/coveragepy#1474
.. _issue 1481: nedbat/coveragepy#1481
.. _issue 1483: nedbat/coveragepy#1483
.. _pull 1387: nedbat/coveragepy#1387
.. _pull 1479: nedbat/coveragepy#1479



Version 6.6.0b1 — 2022-10-31
----------------------------

(Note: 6.6.0 final was never released. These changes are part of `7.0.0b1
<changes_7-0-0b1_>`_.)

- Changes to file pattern matching, which might require updating your
  configuration:

  - Previously, ``*`` would incorrectly match directory separators, making
    precise matching difficult.  This is now fixed, closing `issue 1407`_.

  - Now ``**`` matches any number of nested directories, including none.

- Improvements to combining data files when using the
  :ref:`config_run_relative_files` setting:

  - During ``coverage combine``, relative file paths are implicitly combined
    without needing a ``[paths]`` configuration setting.  This also fixed
    `issue 991`_.

  - A ``[paths]`` setting like ``*/foo`` will now match ``foo/bar.py`` so that
    relative file paths can be combined more easily.

  - The setting is properly interpreted in more places, fixing `issue 1280`_.

- Fixed environment variable expansion in pyproject.toml files.  It was overly
  broad, causing errors outside of coverage.py settings, as described in `issue
  1481`_ and `issue 1345`_.  This is now fixed, but in rare cases will require
  changing your pyproject.toml to quote non-string values that use environment
  substitution.

- Fixed internal logic that prevented coverage.py from running on
  implementations other than CPython or PyPy (`issue 1474`_).

.. _issue 991: nedbat/coveragepy#991
.. _issue 1280: nedbat/coveragepy#1280
.. _issue 1345: nedbat/coveragepy#1345
.. _issue 1407: nedbat/coveragepy#1407
.. _issue 1474: nedbat/coveragepy#1474
.. _issue 1481: nedbat/coveragepy#1481
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed html
Projects
None yet
Development

No branches or pull requests

2 participants