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

Method test_logstart_logfinish_hooks

testing/test_runner.py:260–275  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

258 assert rec.ret == 1
259
260 def test_logstart_logfinish_hooks(self, pytester: Pytester) -> None:
261 rec = pytester.inline_runsource(
262 """
263 import pytest
264 def test_func():
265 pass
266 """
267 )
268 reps = rec.getcalls("pytest_runtest_logstart pytest_runtest_logfinish")
269 assert [x._name for x in reps] == [
270 "pytest_runtest_logstart",
271 "pytest_runtest_logfinish",
272 ]
273 for rep in reps:
274 assert rep.nodeid == "test_logstart_logfinish_hooks.py::test_func"
275 assert rep.location == ("test_logstart_logfinish_hooks.py", 1, "test_func")
276
277 def test_exact_teardown_issue90(self, pytester: Pytester) -> None:
278 rec = pytester.inline_runsource(

Callers

nothing calls this directly

Calls 2

getcallsMethod · 0.80
inline_runsourceMethod · 0.45

Tested by

no test coverage detected