Skip to content

Commit

Permalink
Avoid errors on Windows due to the lack of SYSTEMROOT env var
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed May 23, 2024
1 parent 6540103 commit 23962c2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion setuptools/tests/test_bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,8 @@ def test_bootstrap_sourcetree(tmp_path, bare_venv, setuptools_sourcetree):
assert not (target / "setuptools/tests").is_dir()
assert not (target / "pkg_resources/tests").is_dir()

# Avoid errors on Windows by copying env before modifying
# https://stackoverflow.com/questions/58997105
env = {**os.environ, "PYTHONPATH": str(target)}
test = ["python", "-c", "print(__import__('setuptools').__version__)"]
bare_venv.run(test, env={"PYTHONPATH": str(target)})
bare_venv.run(test, env=env)

0 comments on commit 23962c2

Please sign in to comment.