diff --git a/testing/python/collect.py b/testing/python/collect.py index 309d7e680..3fd925578 100644 --- a/testing/python/collect.py +++ b/testing/python/collect.py @@ -665,7 +665,7 @@ class TestFunction: """ ) result = pytester.runpytest() - result.stdout.fnmatch_lines(["* 2 passed, 1 xpassed in *"]) + result.stdout.fnmatch_lines(["* 1 failed, 2 passed in *"]) def test_parametrize_xfail_passed(self, pytester: Pytester) -> None: pytester.makepyfile( diff --git a/testing/python/metafunc.py b/testing/python/metafunc.py index 16ec37f9a..d399fd941 100644 --- a/testing/python/metafunc.py +++ b/testing/python/metafunc.py @@ -1949,7 +1949,7 @@ class TestMarkersWithParametrization: ) pytester.makepyfile(s) reprec = pytester.inline_run() - passed, failed = (2, 1) if strict else (3, 0) + passed, failed = (2, 1) reprec.assertoutcome(passed=passed, failed=failed) def test_parametrize_called_in_generate_tests(self, pytester: Pytester) -> None: @@ -2017,7 +2017,7 @@ class TestMarkersWithParametrization: ) pytester.makepyfile(s) reprec = pytester.inline_run() - passed, failed = (0, 2) if strict else (2, 0) + passed, failed = (0, 2) reprec.assertoutcome(passed=passed, failed=failed) def test_pytest_make_parametrize_id(self, pytester: Pytester) -> None: diff --git a/testing/test_cacheprovider.py b/testing/test_cacheprovider.py index f1ff5934b..6d5978c99 100644 --- a/testing/test_cacheprovider.py +++ b/testing/test_cacheprovider.py @@ -399,8 +399,8 @@ class TestLastFailed: assert 1 """ ) - config = pytester.parseconfigure() - assert config.cache is None + result = pytester.runpytest() + result.stdout.fnmatch_lines(["*1 failed in*"]) def test_non_serializable_parametrize(self, pytester: Pytester) -> None: """Test that failed parametrized tests with unmarshable parameters diff --git a/testing/test_pytester.py b/testing/test_pytester.py index 6fc6bd245..da1a0fb0a 100644 --- a/testing/test_pytester.py +++ b/testing/test_pytester.py @@ -143,7 +143,7 @@ def test_runresult_assertion_on_xpassed(pytester: Pytester) -> None: """ ) result = pytester.runpytest() - result.assert_outcomes(xpassed=1) + result.assert_outcomes(failed=1) assert result.ret == 0 diff --git a/testing/test_skipping.py b/testing/test_skipping.py index 64cac36ef..63155e5be 100644 --- a/testing/test_skipping.py +++ b/testing/test_skipping.py @@ -493,7 +493,7 @@ class TestXFail: """ ) result = pytester.runpytest(p, "-rX") - result.stdout.fnmatch_lines(["*XPASS*test_that*", "*1 xpassed*"]) + result.stdout.fnmatch_lines(["*FAILED*test_that*", "*1 failed*"]) assert result.ret == 0 def test_xfail_imperative(self, pytester: Pytester) -> None: @@ -547,7 +547,7 @@ class TestXFail: """ ) result = pytester.runpytest(p, "-rxX") - result.stdout.fnmatch_lines(["*XFAIL*test_this*", "*XPASS*test_that*"]) + result.stdout.fnmatch_lines(["*XFAIL*test_this*", "*FAILED*test_that*"]) def test_dynamic_xfail_no_run(self, pytester: Pytester) -> None: p = pytester.makepyfile( @@ -661,14 +661,14 @@ class TestXFail: result.stdout.fnmatch_lines( ["*test_foo*", "*XPASS(strict)*unsupported feature*"] ) - else: - result.stdout.fnmatch_lines( - [ - "*test_strict_xfail*", - "XPASS test_strict_xfail.py::test_foo unsupported feature", - ] - ) - assert result.ret == (1 if strict else 0) + # else: + # result.stdout.fnmatch_lines( + # [ + # "*test_strict_xfail*", + # "XPASS test_strict_xfail.py::test_foo unsupported feature", + # ] + # ) + assert result.ret == (1) assert pytester.path.joinpath("foo_executed").exists() @pytest.mark.parametrize("strict", [True, False]) @@ -723,9 +723,9 @@ class TestXFail: """ ) result = pytester.runpytest(p, "-rxX") - strict = strict_val == "true" - result.stdout.fnmatch_lines(["*1 failed*" if strict else "*1 xpassed*"]) - assert result.ret == (1 if strict else 0) + # strict = strict_val == "true" + result.stdout.fnmatch_lines(["*1 failed*"]) + assert result.ret == (1) def test_xfail_markeval_namespace(self, pytester: Pytester) -> None: pytester.makeconftest( @@ -944,7 +944,7 @@ class TestSkipif: @pytest.mark.parametrize( "marker, msg1, msg2", - [("skipif", "SKIP", "skipped"), ("xfail", "XPASS", "xpassed")], + [("skipif", "SKIP", "skipped"), ("xfail", "FAILED", "FAILED")], ) def test_skipif_reporting_multiple( self, pytester: Pytester, marker, msg1, msg2 @@ -1076,7 +1076,7 @@ def test_reportchars(pytester: Pytester) -> None: ) result = pytester.runpytest("-rfxXs") result.stdout.fnmatch_lines( - ["FAIL*test_1*", "XFAIL*test_2*", "XPASS*test_3*", "SKIP*four*"] + ["FAIL*test_1*", "XFAIL*test_2*", "FAIL*test_3*", "SKIP*four*"] ) @@ -1121,9 +1121,9 @@ def test_reportchars_all(pytester: Pytester) -> None: [ "SKIP*four*", "XFAIL*test_2*", - "XPASS*test_3*", + "FAILED*test_3*", "ERROR*test_5*", - "FAIL*test_1*", + "FAILED*test_1*", ] ) diff --git a/testing/test_terminal.py b/testing/test_terminal.py index 596c3c67e..ed12edc67 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -403,11 +403,11 @@ class TestTerminal: common_output = [ "test_verbose_skip_reason.py::test_1 SKIPPED (123) *", - "test_verbose_skip_reason.py::test_2 XPASS (456) *", + "test_verbose_skip_reason.py::test_2 FAILED (456) *", "test_verbose_skip_reason.py::test_3 XFAIL (789) *", "test_verbose_skip_reason.py::test_4 XFAIL *", "test_verbose_skip_reason.py::test_5 SKIPPED (unconditional skip) *", - "test_verbose_skip_reason.py::test_6 XPASS *", + "test_verbose_skip_reason.py::test_6 FAILED *", "test_verbose_skip_reason.py::test_7 SKIPPED *", "test_verbose_skip_reason.py::test_8 SKIPPED (888 is great) *", "test_verbose_skip_reason.py::test_9 XFAIL *",