File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -82,10 +82,17 @@ def reset_environment() -> Iterator[None]:
8282
8383
8484@pytest .fixture (autouse = True )
85- def reset_filesdotpy_globals () -> Iterator [ None ] :
85+ def reset_filesdotpy_globals () -> None :
8686 """coverage/files.py has some unfortunate globals. Reset them every test."""
8787 set_relative_directory ()
88- yield
88+
89+ @pytest .fixture (autouse = True )
90+ def force_local_pyc_files () -> None :
91+ """Ensure that .pyc files are written next to source files."""
92+ # For some tests, we need .pyc files written in the current directory,
93+ # so override any local setting.
94+ sys .pycache_prefix = None
95+
8996
9097WORKER = os .getenv ("PYTEST_XDIST_WORKER" , "none" )
9198
Original file line number Diff line number Diff line change @@ -27,9 +27,6 @@ install_command = python -m pip install -U {opts} {packages}
2727passenv = *
2828setenv =
2929 pypy3{,9,10,11}: COVERAGE_TEST_CORES =pytrace
30- # For some tests, we need .pyc files written in the current directory,
31- # so override any local setting.
32- PYTHONPYCACHEPREFIX =
3330 # If we ever need a stronger way to suppress warnings:
3431 # PYTHONWARNINGS=ignore:removed in Python 3.14; use ast.Constant:DeprecationWarning
3532 # Disable CPython's color output
You can’t perform that action at this time.
0 commit comments