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

Method test_assertion_rewrite

testing/acceptance_test.py:152–162  ·  view source on GitHub ↗
(self, pytester: Pytester, import_mode)

Source from the content-addressed store, hash-verified

150
151 @pytest.mark.parametrize("import_mode", ["prepend", "append", "importlib"])
152 def test_assertion_rewrite(self, pytester: Pytester, import_mode) -> None:
153 p = pytester.makepyfile(
154 """
155 def test_this():
156 x = 0
157 assert x
158 """
159 )
160 result = pytester.runpytest(p, f"--import-mode={import_mode}")
161 result.stdout.fnmatch_lines(["> assert x", "E assert 0"])
162 assert result.ret == 1
163
164 def test_nested_import_error(self, pytester: Pytester) -> None:
165 p = pytester.makepyfile(

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected