Skip to content

Commit 25eed21

Browse files
committed
Turns out there were some internal changes in the pytester plugin.
1 parent 42d7705 commit 25eed21

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/test_pytest_cov.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,8 +1538,14 @@ def test_cover_looponfail(testdir, monkeypatch):
15381538
testdir.makeconftest(CONFTEST)
15391539
script = testdir.makepyfile(BASIC_TEST)
15401540

1541-
monkeypatch.setattr(testdir, 'run',
1542-
lambda *args, **kwargs: _TestProcess(*map(str, args)))
1541+
def mock_run(*args, **kwargs):
1542+
return _TestProcess(*map(str, args))
1543+
1544+
monkeypatch.setattr(testdir, 'run', mock_run)
1545+
assert testdir.run is mock_run
1546+
if hasattr(testdir, '_pytester'):
1547+
monkeypatch.setattr(testdir._pytester, 'run', mock_run)
1548+
assert testdir._pytester.run is mock_run
15431549
with testdir.runpytest('-v',
15441550
'--cov=%s' % script.dirpath(),
15451551
'--looponfail',

0 commit comments

Comments
 (0)