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

Method test_scope_exc

testing/python/fixtures.py:2325–2352  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

2323 reprec.assertoutcome(skipped=2, passed=1)
2324
2325 def test_scope_exc(self, pytester: Pytester) -> None:
2326 pytester.makepyfile(
2327 test_foo="""
2328 def test_foo(fix):
2329 pass
2330 """,
2331 test_bar="""
2332 def test_bar(fix):
2333 pass
2334 """,
2335 conftest="""
2336 import pytest
2337 reqs = []
2338 @pytest.fixture(scope="session")
2339 def fix(request):
2340 reqs.append(1)
2341 pytest.skip()
2342 @pytest.fixture
2343 def req_list():
2344 return reqs
2345 """,
2346 test_real="""
2347 def test_last(req_list):
2348 assert req_list == [1]
2349 """,
2350 )
2351 reprec = pytester.inline_run()
2352 reprec.assertoutcome(skipped=2, passed=1)
2353
2354 def test_scope_module_uses_session(self, pytester: Pytester) -> None:
2355 pytester.makepyfile(

Callers

nothing calls this directly

Calls 3

assertoutcomeMethod · 0.80
makepyfileMethod · 0.45
inline_runMethod · 0.45

Tested by

no test coverage detected