From b551502b0da81ab6978e6851f2173ac0b42ba454 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 4 Aug 2019 08:25:09 -0400 Subject: [PATCH] Don't be fooled by "coverage" in a path. --- tests/test_pytest_cov.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_pytest_cov.py b/tests/test_pytest_cov.py index 7ef28122..7afaf5cb 100644 --- a/tests/test_pytest_cov.py +++ b/tests/test_pytest_cov.py @@ -1658,7 +1658,11 @@ def test_disabled_output(testdir): '--cov-report=', script) - assert 'coverage' not in result.stdout.str() + stdout = result.stdout.str() + # We don't want the path to the executable to fail the test if we happen + # to put the project in a directory with "coverage" in it. + stdout = stdout.replace(sys.executable, "") + assert 'coverage' not in stdout assert result.ret == 0