Skip to content

Commit

Permalink
copy os.environ for windows %SYSTEMROOT% variable, format with black
Browse files Browse the repository at this point in the history
  • Loading branch information
AlJohri committed Nov 5, 2019
1 parent c1ad487 commit 826afdd
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions tests/test_run.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python3
import os
import logging
import sys
import subprocess
Expand Down Expand Up @@ -44,9 +45,25 @@ def test_run_script_from_internet(pipx_temp_env, capsys):
]
)


def test_run_ensure_null_pythonpath():
assert 'None' in subprocess.run(
[sys.executable, "-m", "pipx", "run", "ipython", "-c", "import os; print(os.environ.get('PYTHONPATH'))"],
universal_newlines=True,
env={'PYTHONPATH': 'test'},
stdout=subprocess.PIPE, stderr=subprocess.PIPE).stdout
env = os.environ.copy()
env["PYTHONPATH"] = "test"
assert (
"None"
in subprocess.run(
[
sys.executable,
"-m",
"pipx",
"run",
"ipython",
"-c",
"import os; print(os.environ.get('PYTHONPATH'))",
],
universal_newlines=True,
env=env,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
).stdout
)

0 comments on commit 826afdd

Please sign in to comment.