summaryrefslogtreecommitdiff
path: root/testing/test_cacheprovider.py
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2019-05-29 23:12:45 +0200
committerDaniel Hahler <git@thequod.de>2019-05-29 23:24:52 +0200
commitceb4f3f701e330221f13a7ee66a2199b9b5e82e6 (patch)
tree0e9e2b50c362ceeaea632b010f502c9264fb0f92 /testing/test_cacheprovider.py
parentbf3b26b3f72d46bf64a2a6c64da03f93f24b47af (diff)
downloadpytest-ceb4f3f701e330221f13a7ee66a2199b9b5e82e6.tar.gz
fixup! Fix regression with --lf and non-selected failures
Diffstat (limited to 'testing/test_cacheprovider.py')
-rw-r--r--testing/test_cacheprovider.py24
1 files changed, 23 insertions, 1 deletions
diff --git a/testing/test_cacheprovider.py b/testing/test_cacheprovider.py
index da6a3da49..ed205d0f8 100644
--- a/testing/test_cacheprovider.py
+++ b/testing/test_cacheprovider.py
@@ -832,7 +832,7 @@ class TestLastFailed(object):
]
)
- def test_lastfailed_with_unknown_failure(self, testdir):
+ def test_lastfailed_with_known_failures_not_being_selected(self, testdir):
testdir.makepyfile(
**{
"pkg1/test_1.py": """def test_1(): assert 0""",
@@ -852,6 +852,28 @@ class TestLastFailed(object):
]
)
+ # Recreate file with known failure.
+ testdir.makepyfile(**{"pkg1/test_1.py": """def test_1(): assert 0"""})
+ result = testdir.runpytest("--lf")
+ result.stdout.fnmatch_lines(
+ [
+ "collected 1 item",
+ "run-last-failure: rerun previous 1 failure (skipped 1 file)",
+ "* 1 failed in *",
+ ]
+ )
+
+ # Remove/rename test.
+ testdir.makepyfile(**{"pkg1/test_1.py": """def test_renamed(): assert 0"""})
+ result = testdir.runpytest("--lf")
+ result.stdout.fnmatch_lines(
+ [
+ "collected 1 item",
+ "run-last-failure: 1 known failures not in selected tests",
+ "* 1 failed in *",
+ ]
+ )
+
class TestNewFirst(object):
def test_newfirst_usecase(self, testdir):