Fix pytest tests invocation with custom PYTHONPATH

Fixes https://github.com/pytest-dev/pytest/issues/4913

Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
This commit is contained in:
Miro Hrončok 2019-03-12 16:28:10 +01:00
parent 51bf7c3aef
commit d32ab6029f
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 print_function
import os
import pprint
import sys
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():
result = testdir.runpytest_subprocess()
result.stdout.fnmatch_lines(["*1 passed in*"])