Make xpass a failure again #11467

This commit is contained in:
TanyaAgarwal28 2023-10-12 14:00:20 +05:30
parent 449ce358c0
commit fd6dd2a545
2 changed files with 12 additions and 14 deletions

View File

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

View File

@ -164,7 +164,7 @@ class TestPython:
result, dom = run_and_parse(family=xunit_family)
assert result.ret
node = dom.find_first_by_tag("testsuite")
node.assert_attr(name="pytest", errors=0, failures=1, skipped=2, tests=5)
node.assert_attr(name="pytest", errors=0, failures=2, skipped=2, tests=5)
@parametrize_families
def test_summing_simple_with_errors(