Merge pull request #4914 from hroncok/issue4913

Fix pytest tests invocation with custom PYTHONPATH
This commit is contained in:
Daniel Hahler 2019-03-12 18:58:54 +01:00 committed by GitHub
commit 6630d96253
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -0,0 +1 @@
Fix pytest tests invocation with custom ``PYTHONPATH``.

View File

@ -2,6 +2,7 @@ from __future__ import absolute_import
from __future__ import division from __future__ import division
from __future__ import print_function from __future__ import print_function
import os
import pprint import pprint
import sys import sys
import textwrap import textwrap
@ -1108,7 +1109,7 @@ def test_collect_pyargs_with_testpaths(testdir, monkeypatch):
""" """
) )
) )
monkeypatch.setenv("PYTHONPATH", str(testdir.tmpdir)) monkeypatch.setenv("PYTHONPATH", str(testdir.tmpdir), prepend=os.pathsep)
with root.as_cwd(): with root.as_cwd():
result = testdir.runpytest_subprocess() result = testdir.runpytest_subprocess()
result.stdout.fnmatch_lines(["*1 passed in*"]) result.stdout.fnmatch_lines(["*1 passed in*"])