Skip to content

Commit

Permalink
Merge pull request #1681 from dstufft/fix-setuppy-test
Browse files Browse the repository at this point in the history
Pass the sys.path into the subprocess
  • Loading branch information
reaperhulk committed Feb 20, 2015
2 parents 1b2a616 + e8179e7 commit 8be38b3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/hazmat/backends/test_openssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,19 @@ def test_osrandom_engine_is_default(self, tmpdir):
)
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
)

Expand Down

0 comments on commit 8be38b3

Please sign in to comment.