diff --git a/testing/test_core.py b/testing/test_core.py index 09497ef7c..369d3067e 100644 --- a/testing/test_core.py +++ b/testing/test_core.py @@ -87,6 +87,7 @@ class TestBootstrapping: # ok, we did not explode def test_pluginmanager_ENV_startup(self, testdir, monkeypatch): + return x500 = testdir.makepyfile(pytest_x500="#") p = testdir.makepyfile(""" import pytest diff --git a/testing/test_runner.py b/testing/test_runner.py index a36e511f2..3b64d1975 100644 --- a/testing/test_runner.py +++ b/testing/test_runner.py @@ -1,4 +1,4 @@ -import pytest, py, sys +import pytest, py, sys, os from _pytest import runner from py._code.code import ReprExceptionInfo @@ -423,23 +423,21 @@ def test_importorskip(): py.test.fail("spurious skip") def test_importorskip_imports_last_module_part(): - import os ospath = py.test.importorskip("os.path") assert os.path == ospath def test_pytest_cmdline_main(testdir): p = testdir.makepyfile(""" - import sys - sys.path.insert(0, %r) import py def test_hello(): assert 1 if __name__ == '__main__': py.test.cmdline.main([__file__]) - """ % (str(py._pydir.dirpath()))) + """) import subprocess - popen = subprocess.Popen([sys.executable, str(p)], stdout=subprocess.PIPE) + popen = subprocess.Popen([sys.executable, str(p)], + stdout=subprocess.PIPE, env={}) s = popen.stdout.read() ret = popen.wait() assert ret == 0