Skip to content

EliahKagan/pytest-cov-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pytest-cov-test - Simplified demonstration of GitPython #2052

This is a simplified demonstration of the mechanism underlying the bug fixed in gitpython-developers/GitPython#2052 where a test that runs a subprocess, making an assertion about what the subprocess writes to stderr, can fail due to CoverageWarning messages produced in the subprocess by pytest-cov.

Running the test

On Cygwin:

python3.9 -m venv .venv
. .venv/bin/activate
python -m pip install -U pip setuptools wheel
pip install -e .
pytest -v

The failure

As there, it is specifically on Cygwin that this currently fails, since the warning is not typically generated otherwise. The failure looks like:

>       assert proc.stderr == f"{sys.executable=}\n"
E       assert "/home/ek/rep...bin/python'\n" == "sys.executab...bin/python'\n"
E
E         + /home/ek/repos-cygwin/pytest-cov-test/.venv/lib/python3.9/site-packages/coverage/core.py:96: CoverageWarning: Couldn't import C tracer: No module named 'coverage.tracer' (no-ctracer)
E         +   warn(f"Couldn't import C tracer: {IMPORT_ERROR}", slug="no-ctracer", once=True)
E           sys.executable='/home/ek/repos-cygwin/pytest-cov-test/.venv/bin/python'

test_indirect.py:14: AssertionError

License

0BSD

About

Simplified demonstration of GitPython #2052

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages