diff options
author | Daniel Hahler <git@thequod.de> | 2019-05-29 22:43:24 +0200 |
---|---|---|
committer | Daniel Hahler <git@thequod.de> | 2019-05-29 22:44:43 +0200 |
commit | bf3b26b3f72d46bf64a2a6c64da03f93f24b47af (patch) | |
tree | e1fd599d153c521ec36be8a3b61e69d099ed6fca /testing/test_cacheprovider.py | |
parent | 5c5966f62d096b4393cb8b69752481096393005e (diff) | |
download | pytest-bf3b26b3f72d46bf64a2a6c64da03f93f24b47af.tar.gz |
Fix regression with --lf and non-selected failures
Diffstat (limited to 'testing/test_cacheprovider.py')
-rw-r--r-- | testing/test_cacheprovider.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/testing/test_cacheprovider.py b/testing/test_cacheprovider.py index 5024701f1..da6a3da49 100644 --- a/testing/test_cacheprovider.py +++ b/testing/test_cacheprovider.py @@ -832,6 +832,26 @@ class TestLastFailed(object): ] ) + def test_lastfailed_with_unknown_failure(self, testdir): + testdir.makepyfile( + **{ + "pkg1/test_1.py": """def test_1(): assert 0""", + "pkg1/test_2.py": """def test_2(): pass""", + } + ) + result = testdir.runpytest() + result.stdout.fnmatch_lines(["collected 2 items", "* 1 failed, 1 passed in *"]) + + py.path.local("pkg1/test_1.py").remove() + result = testdir.runpytest("--lf") + result.stdout.fnmatch_lines( + [ + "collected 1 item", + "run-last-failure: 1 known failures not in selected tests", + "* 1 passed in *", + ] + ) + class TestNewFirst(object): def test_newfirst_usecase(self, testdir): |