Skip to content

Commit 95e2b2f

Browse files
committed
Don't override existing PYTHONPATH for tests.
We can prepend some new paths at the beginning, but we don't want to lose any existing module search paths when doing so.
1 parent 0cf66ad commit 95e2b2f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/future/tests/base.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,11 @@ def setUp(self):
152152
""")
153153
self.interpreters = [sys.executable]
154154
self.tempdir = tempfile.mkdtemp() + os.path.sep
155-
self.env = {'PYTHONPATH': os.getcwd()}
155+
pypath = os.getenv('PYTHONPATH')
156+
if pypath:
157+
self.env = {'PYTHONPATH': os.getcwd() + os.pathsep + pypath}
158+
else:
159+
self.env = {'PYTHONPATH': os.getcwd()}
156160

157161
def convert(self, code, stages=(1, 2), all_imports=False, from3=False,
158162
reformat=True, run=True, conservative=False):

0 commit comments

Comments
 (0)