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

Method test_rewrite_warning

testing/test_assertrewrite.py:950–959  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

948 assert pytester.runpytest().ret == ExitCode.NO_TESTS_COLLECTED
949
950 def test_rewrite_warning(self, pytester: Pytester) -> None:
951 pytester.makeconftest(
952 """
953 import pytest
954 pytest.register_assert_rewrite("_pytest")
955 """
956 )
957 # needs to be a subprocess because pytester explicitly disables this warning
958 result = pytester.runpytest_subprocess()
959 result.stdout.fnmatch_lines(["*Module already imported*: _pytest"])
960
961 def test_rewrite_module_imported_from_conftest(self, pytester: Pytester) -> None:
962 pytester.makeconftest(

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makeconftestMethod · 0.45
runpytest_subprocessMethod · 0.45

Tested by

no test coverage detected