question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pytest_cov.__version__ string is broken on >=2.10.1

See original GitHub issue

Summary

Expected vs actual result

I expect pytest_cov.__version__ == 'x.y.z', but as of 2.10.1 it’s pytest_cov.__version__ == "__version__ = 'x.y.z'": https://github.com/pytest-dev/pytest-cov/commit/da61b912c48fadf6df71c8cd4712a23dbdc2efc0#diff-cfb899e3f5cac1afba8f5bafcd74392faf2677836ed2f3b068217df610ea6e82R2

This broke code that relied on the version string. There’s no explanation in the CHANGELOG: https://github.com/pytest-dev/pytest-cov/blob/2cd009442ddb08dc873117019b13ef972803d5c4/CHANGELOG.rst#L36-L42

Looking at PEP 396 I’m not sure this is valid: https://www.python.org/dev/peps/pep-0396/#id27

Reproducer

Versions

Output of relevant packages pip list, python --version, pytest --version etc.

$ python3 --version
Python 3.8.5
$ pytest --version
pytest 6.2.2
$ pytest --version --version
This is pytest version 6.2.2, imported from /home/chris/.local/lib/python3.8/site-packages/pytest/__init__.py
setuptools registered plugins:
  pytest-rerunfailures-9.1.1 at /home/chris/.local/lib/python3.8/site-packages/pytest_rerunfailures.py
  pytest-repeat-0.9.1 at /home/chris/.local/lib/python3.8/site-packages/pytest_repeat.py
  pytest-cov-2.11.1 at /home/chris/.local/lib/python3.8/site-packages/pytest_cov/plugin.py
  colcon-core-0.6.1 at /usr/lib/python3/dist-packages/colcon_core/pytest/hooks.py
  pytest-mock-1.10.4 at /usr/lib/python3/dist-packages/pytest_mock.py

Config

N/A

Code

>>> from pkg_resources import parse_version
>>> from pytest_cov import __version__ as pytest_cov_version
>>> pytest_cov_version
"__version__ = '2.11.1'"
>>> parse_version('2.11.1') >= parse_version('2.5.0')
True
>>> parse_version(pytest_cov_version) >= parse_version('2.5.0')
False

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ionelmccommented, May 14, 2021

Just released 2.12

1reaction
ionelmccommented, May 14, 2021

Yes, yes. Gonna sort it out this week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pytest-cov - PyPI
This plugin produces coverage reports. Compared to just using coverage run this plugin does some extras: Subprocess support: you can fork or run...
Read more >
pytest-cov - Read the Docs
This plugin produces coverage reports. Compared to just using coverage run this plugin does some extras: • Subprocess support: you can fork ...
Read more >
Pip requirements installation fails in Travis due to idna version ...
As a quick fix, you can pin your idna version in your requirements.txt to 2.05. As a longer-term solution, you can adopt a...
Read more >
ModuleNotFoundError: No module named 'coverage'
INFO: pip is looking at multiple versions of pytest-cov to determine ... We might want to fix it by pinning it to a...
Read more >
latest PDF - pytest Documentation
example to early-load the pytest-cov plugin you can use: ... Disable rewriting for a specific module by adding the string ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found