Skip to content

Commit

Permalink
Turns out there were some internal changes in the pytester plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
ionelmc committed Jan 11, 2021
1 parent 42d7705 commit 25eed21
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/test_pytest_cov.py
Original file line number Diff line number Diff line change
Expand Up @@ -1538,8 +1538,14 @@ def test_cover_looponfail(testdir, monkeypatch):
testdir.makeconftest(CONFTEST)
script = testdir.makepyfile(BASIC_TEST)

monkeypatch.setattr(testdir, 'run',
lambda *args, **kwargs: _TestProcess(*map(str, args)))
def mock_run(*args, **kwargs):
return _TestProcess(*map(str, args))

monkeypatch.setattr(testdir, 'run', mock_run)
assert testdir.run is mock_run
if hasattr(testdir, '_pytester'):
monkeypatch.setattr(testdir._pytester, 'run', mock_run)
assert testdir._pytester.run is mock_run
with testdir.runpytest('-v',
'--cov=%s' % script.dirpath(),
'--looponfail',
Expand Down

0 comments on commit 25eed21

Please sign in to comment.