Skip to content

Commit a2ba480

Browse files
committed
Have test_installation test that operations produce no warnings
By setting the `PYTHONWARNINGS` environment variable to `error` in each of the subprocess invocations. This is strictly stronger than passing `-Werror` for the `python` commands, because it automatically applies to subprocesses (unless they are created with a sanitized environment or otherwise with one in which `PYTHONWARNINGS` has been customized), and because it works for `pip` automatically. Importantly, this will cause warnings internal to Python subprocesses created by `pip` to be treated as errors. It should thus surface any warnings coming from the `setuptools` backend.
1 parent 84632c7 commit a2ba480

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

test/test_installation.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def _set_up_venv(rw_dir):
6464
subprocess.run,
6565
stdout=subprocess.PIPE,
6666
cwd=venv.sources,
67+
env={**os.environ, "PYTHONWARNINGS": "error"},
6768
)
6869

6970
return venv, run

0 commit comments

Comments
 (0)