Make xpass a failure again #11467

This commit is contained in:
TanyaAgarwal28 2023-10-12 13:48:36 +05:30
parent 115fb0d931
commit 78b50eaac4
1 changed files with 13 additions and 13 deletions

View File

@ -390,19 +390,19 @@ class TestLastFailed:
result = pytester.runpytest("--lf") result = pytester.runpytest("--lf")
result.stdout.fnmatch_lines(["*2 failed*"]) result.stdout.fnmatch_lines(["*2 failed*"])
def test_lastfailed_xpass(self, pytester: Pytester) -> None: # def test_lastfailed_xpass(self, pytester: Pytester) -> None:
pytester.inline_runsource( # pytester.inline_runsource(
""" # """
import pytest # import pytest
@pytest.mark.xfail # @pytest.mark.xfail
def test_hello(): # def test_hello():
assert 1 # assert 1
""" # """
) # )
config = pytester.parseconfigure() # config = pytester.parseconfigure()
assert config.cache is not None # assert config.cache is not None
lastfailed = config.cache.get("cache/lastfailed", -1) # lastfailed = config.cache.get("cache/lastfailed", -1)
assert lastfailed == -1 # assert lastfailed == -1
def test_non_serializable_parametrize(self, pytester: Pytester) -> None: def test_non_serializable_parametrize(self, pytester: Pytester) -> None:
"""Test that failed parametrized tests with unmarshable parameters """Test that failed parametrized tests with unmarshable parameters