mirror of
https://github.com/saymrwulf/cryptography.git
synced 2026-05-14 20:37:55 +00:00
Merge pull request #1681 from dstufft/fix-setuppy-test
Pass the sys.path into the subprocess
This commit is contained in:
commit
8be38b3927
1 changed files with 10 additions and 0 deletions
|
|
@ -234,9 +234,19 @@ class TestOpenSSLRandomEngine(object):
|
|||
)
|
||||
engine_name = tmpdir.join('engine_name')
|
||||
|
||||
# If we're running tests via ``python setup.py test`` in a clean
|
||||
# environment then all of our dependencies are going to be installed
|
||||
# into either the current directory or the .eggs directory. However the
|
||||
# subprocess won't know to activate these dependencies, so we'll get it
|
||||
# to do so by passing our entire sys.path into the subprocess via the
|
||||
# PYTHONPATH environment variable.
|
||||
env = os.environ.copy()
|
||||
env["PYTHONPATH"] = os.pathsep.join(sys.path)
|
||||
|
||||
with engine_name.open('w') as out:
|
||||
subprocess.check_call(
|
||||
[sys.executable, "-c", engine_printer],
|
||||
env=env,
|
||||
stdout=out
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue