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

Method hook_on

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

Source from the content-addressed store, hash-verified

1501
1502 @pytest.fixture
1503 def hook_on(self, pytester: Pytester):
1504 pytester.makeconftest(
1505 """\
1506 def pytest_assertion_pass(item, lineno, orig, expl):
1507 raise Exception("Assertion Passed: {} {} at line {}".format(orig, expl, lineno))
1508 """
1509 )
1510
1511 def test_hook_call(self, pytester: Pytester, flag_on, hook_on) -> None:
1512 pytester.makepyfile(

Callers

nothing calls this directly

Calls 1

makeconftestMethod · 0.45

Tested by

no test coverage detected