aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2015-02-20 09:44:34 -0600
committerPaul Kehrer <paul.l.kehrer@gmail.com>2015-02-20 09:44:34 -0600
commit8be38b39270d4545bb303eb08fa5e84940de04a2 (patch)
treec27d0757c526ac57c5beed5e2a70457805252f08 /tests
parent1b2a616174951d723df791695a461871a46042c4 (diff)
parente8179e79bcb1d8d6e09fffe8e0123afce09ce02d (diff)
downloadcryptography-8be38b39270d4545bb303eb08fa5e84940de04a2.tar.gz
cryptography-8be38b39270d4545bb303eb08fa5e84940de04a2.tar.bz2
cryptography-8be38b39270d4545bb303eb08fa5e84940de04a2.zip
Merge pull request #1681 from dstufft/fix-setuppy-test
Pass the sys.path into the subprocess
Diffstat (limited to 'tests')
-rw-r--r--tests/hazmat/backends/test_openssl.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/hazmat/backends/test_openssl.py b/tests/hazmat/backends/test_openssl.py
index 2bf66a0c..0e4d75ed 100644
--- a/tests/hazmat/backends/test_openssl.py
+++ b/tests/hazmat/backends/test_openssl.py
@@ -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
)