Skip to content

Commit 6630d96

Browse files
authored
Merge pull request #4914 from hroncok/issue4913
Fix pytest tests invocation with custom PYTHONPATH
2 parents 76c00d1 + d32ab60 commit 6630d96

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

changelog/4913.trivial.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix pytest tests invocation with custom ``PYTHONPATH``.

testing/test_collection.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from __future__ import division
33
from __future__ import print_function
44

5+
import os
56
import pprint
67
import sys
78
import textwrap
@@ -1108,7 +1109,7 @@ def test_collect_pyargs_with_testpaths(testdir, monkeypatch):
11081109
"""
11091110
)
11101111
)
1111-
monkeypatch.setenv("PYTHONPATH", str(testdir.tmpdir))
1112+
monkeypatch.setenv("PYTHONPATH", str(testdir.tmpdir), prepend=os.pathsep)
11121113
with root.as_cwd():
11131114
result = testdir.runpytest_subprocess()
11141115
result.stdout.fnmatch_lines(["*1 passed in*"])

0 commit comments

Comments
 (0)