@@ -1080,22 +1080,23 @@ def test_increment(n, expected):
1080
1080
reprec = testdir .inline_run ()
1081
1081
reprec .assertoutcome (passed = 2 , skipped = 1 )
1082
1082
1083
- def test_xfail_passing_is_xpass (self , testdir ):
1083
+ @pytest .mark .parametrize ('strict' , [True , False ])
1084
+ def test_xfail_passing_is_xpass (self , testdir , strict ):
1084
1085
s = """
1085
1086
import pytest
1086
1087
1087
1088
@pytest.mark.parametrize(("n", "expected"), [
1088
1089
(1, 2),
1089
- pytest.mark.xfail("sys.version > 0", reason="some bug")((2, 3)),
1090
+ pytest.mark.xfail("sys.version_info.major > 0", reason="some bug", strict={strict} )((2, 3)),
1090
1091
(3, 4),
1091
1092
])
1092
1093
def test_increment(n, expected):
1093
1094
assert n + 1 == expected
1094
- """
1095
+ """ . format ( strict = strict )
1095
1096
testdir .makepyfile (s )
1096
1097
reprec = testdir .inline_run ()
1097
- # xpass is fail, obviously : )
1098
- reprec .assertoutcome (passed = 2 , failed = 1 )
1098
+ passed , failed = ( 2 , 1 ) if strict else ( 3 , 0 )
1099
+ reprec .assertoutcome (passed = passed , failed = failed )
1099
1100
1100
1101
def test_parametrize_called_in_generate_tests (self , testdir ):
1101
1102
s = """
0 commit comments