tests/test_pytest_cov.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/test_pytest_cov.py b/tests/test_pytest_cov.py index 84fe42b..2603590 100644 --- a/tests/test_pytest_cov.py +++ b/tests/test_pytest_cov.py @@ -166,6 +166,10 @@ def adjust_sys_path(): new_path = os.path.dirname(__file__) if orig_path is not None: new_path = os.pathsep.join([new_path, orig_path]) + + new_path = os.pathsep.join( + [new_path, os.environ.get('PYTHONPATH_PY3', '')] + ) os.environ['PYTHONPATH'] = new_path yield @@ -904,7 +908,12 @@ def test_central_subprocess_change_cwd_with_pythonpath(pytester, testdir, monkey parallel = true """) - monkeypatch.setitem(os.environ, 'PYTHONPATH', str(stuff)) + new_path = str(stuff) + new_path = os.pathsep.join( + [new_path, os.environ.get('PYTHONPATH_PY3', '')] + ) + monkeypatch.setitem(os.environ, 'PYTHONPATH', str(new_path)) + result = testdir.runpytest('-vv', '-s', '--cov=child_script', '--cov-config=coveragerc', @@ -1032,7 +1041,7 @@ def test_invalid_coverage_source(testdir): def test_dist_missing_data(testdir): """Test failure when using a worker without pytest-cov installed.""" venv_path = os.path.join(str(testdir.tmpdir), 'venv') - virtualenv.cli_run([venv_path]) + virtualenv.cli_run([venv_path, "--system-site-packages",]) if sys.platform == 'win32': if platform.python_implementation() == "PyPy": exe = os.path.join(venv_path, 'bin', 'python.exe') @@ -1556,6 +1565,8 @@ def test_foo(): SCRIPT_SIMPLE_RESULT = '4 * 100%' +@pytest.mark.skipif('tuple(int(x) for x in xdist.__version__.split(".")) >= (2, 5, 0)', + reason="--boxed option was removed in version 2.5.0") @pytest.mark.skipif('sys.platform == "win32"') def test_dist_boxed(testdir): script = testdir.makepyfile(SCRIPT_SIMPLE) @@ -1916,6 +1927,7 @@ EXPECTED_CONTEXTS = { @pytest.mark.skipif("coverage.version_info < (5, 0)") +@pytest.mark.skipif("coverage.version_info > (6, 4)") @xdist_params def test_contexts(pytester, testdir, opts): with open(os.path.join(os.path.dirname(__file__), "contextful.py")) as f: