nixpkgs/pkgs/development/python-modules/jupyter_core/tests_respect_pythonpath.patch
2017-12-31 11:01:53 +01:00

21 lines
959 B
Diff

--- a/jupyter_core/tests/test_command.py
+++ b/jupyter_core/tests/test_command.py
@@ -131,7 +131,7 @@ def test_not_on_path(tmpdir):
witness_src = '#!%s\n%s\n' % (sys.executable, 'print("WITNESS ME")')
write_executable(witness, witness_src)
- env = {'PATH': ''}
+ env = {'PATH': '', 'PYTHONPATH': os.environ['PYTHONPATH']}
if 'SYSTEMROOT' in os.environ: # Windows http://bugs.python.org/issue20614
env[str('SYSTEMROOT')] = os.environ['SYSTEMROOT']
if sys.platform == 'win32':
@@ -157,7 +157,7 @@ def test_path_priority(tmpdir):
witness_b_src = '#!%s\n%s\n' % (sys.executable, 'print("WITNESS B")')
write_executable(witness_b, witness_b_src)
- env = {'PATH': str(b)}
+ env = {'PATH': str(b), 'PYTHONPATH': os.environ['PYTHONPATH']}
if 'SYSTEMROOT' in os.environ: # Windows http://bugs.python.org/issue20614
env[str('SYSTEMROOT')] = os.environ['SYSTEMROOT']
if sys.platform == 'win32':