Skip to content

Commit 2256f2f

Browse files
committed
Remove test which is no longer required and improve test_lf_and_ff_prints_no_needless_message
* test_lf_and_ff_obey_verbosity is no longer necessary because test_lf_and_ff_prints_no_needless_message already checks if the proper messages are displayed when -q is used. * Improve test_lf_and_ff_prints_no_needless_message so we also check that the correct message is displayed when there are failures to run
1 parent 11e591e commit 2256f2f

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

testing/test_cacheprovider.py

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -553,19 +553,6 @@ def test_lastfailed_creates_cache_when_needed(self, testdir):
553553
testdir.runpytest("-q", "--lf")
554554
assert os.path.exists(".pytest_cache/v/cache/lastfailed")
555555

556-
@pytest.mark.parametrize("quiet", [True, False])
557-
@pytest.mark.parametrize("opt", ["--ff", "--lf"])
558-
def test_lf_and_ff_obey_verbosity(self, quiet, opt, testdir):
559-
testdir.makepyfile("def test(): pass")
560-
args = [opt]
561-
if quiet:
562-
args.append("-q")
563-
result = testdir.runpytest(*args)
564-
if quiet:
565-
assert "run all" not in result.stdout.str()
566-
else:
567-
assert "run all" in result.stdout.str()
568-
569556
def test_xfail_not_considered_failure(self, testdir):
570557
testdir.makepyfile(
571558
"""
@@ -628,13 +615,19 @@ def test():
628615
@pytest.mark.parametrize("opt", ["--ff", "--lf"])
629616
def test_lf_and_ff_prints_no_needless_message(self, quiet, opt, testdir):
630617
# Issue 3853
631-
testdir.makepyfile("def test(): pass")
618+
testdir.makepyfile("def test(): assert 0")
632619
args = [opt]
633620
if quiet:
634621
args.append("-q")
635622
result = testdir.runpytest(*args)
636623
assert "run all" not in result.stdout.str()
637624

625+
result = testdir.runpytest(*args)
626+
if quiet:
627+
assert "run all" not in result.stdout.str()
628+
else:
629+
assert "rerun previous" in result.stdout.str()
630+
638631
def get_cached_last_failed(self, testdir):
639632
config = testdir.parseconfigure()
640633
return sorted(config.cache.get("cache/lastfailed", {}))

0 commit comments

Comments
 (0)