MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_ignore

Function test_ignore

testing/test_warnings.py:111–123  ·  view source on GitHub ↗
(pytester: Pytester, pyfile_with_warnings, method)

Source from the content-addressed store, hash-verified

109
110@pytest.mark.parametrize("method", ["cmdline", "ini"])
111def test_ignore(pytester: Pytester, pyfile_with_warnings, method) -> None:
112 args = ("-W", "ignore") if method == "cmdline" else ()
113 if method == "ini":
114 pytester.makeini(
115 """
116 [pytest]
117 filterwarnings= ignore
118 """
119 )
120
121 result = pytester.runpytest(*args, pyfile_with_warnings)
122 result.stdout.fnmatch_lines(["* 1 passed in *"])
123 assert WARNINGS_SUMMARY_HEADER not in result.stdout.str()
124
125
126@pytest.mark.filterwarnings("always::UserWarning")

Callers

nothing calls this directly

Calls 4

fnmatch_linesMethod · 0.80
strMethod · 0.80
makeiniMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected