From 4fe3f8c471bd90f81017dce15e6cbd2f61cdce39 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 6 Jul 2021 10:20:43 +0200 Subject: Fix check_coverage.py tests with pytest 7.0 See https://github.com/pytest-dev/pytest/pull/8247 --- tests/unit/scripts/test_check_coverage.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests') diff --git a/tests/unit/scripts/test_check_coverage.py b/tests/unit/scripts/test_check_coverage.py index efd35ce82..abb0969b6 100644 --- a/tests/unit/scripts/test_check_coverage.py +++ b/tests/unit/scripts/test_check_coverage.py @@ -98,7 +98,12 @@ def covtest(testdir, monkeypatch): # Check if coverage plugin is available res = testdir.runpytest('--version', '--version') assert res.ret == 0 + output = res.stderr.str() + if not output: + # pytest >= 7.0: https://github.com/pytest-dev/pytest/pull/8247 + output = res.stdout.str() + assert 'This is pytest version' in output if 'pytest-cov' not in output: pytest.skip("cov plugin not available") -- cgit v1.2.3-54-g00ecf