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

Function test_sessionfinish_with_start

testing/test_session.py:320–335  ·  view source on GitHub ↗
(pytester: Pytester)

Source from the content-addressed store, hash-verified

318
319
320def test_sessionfinish_with_start(pytester: Pytester) -> None:
321 pytester.makeconftest(
322 """
323 import os
324 values = []
325 def pytest_sessionstart():
326 values.append(os.getcwd())
327 os.chdir("..")
328
329 def pytest_sessionfinish():
330 assert values[0] == os.getcwd()
331
332 """
333 )
334 res = pytester.runpytest("--collect-only")
335 assert res.ret == ExitCode.NO_TESTS_COLLECTED
336
337
338@pytest.mark.parametrize("path", ["root", "{relative}/root", "{environment}/root"])

Callers

nothing calls this directly

Calls 2

makeconftestMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected