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

Method test_scope_session

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

Source from the content-addressed store, hash-verified

2252 reprec.assertoutcome(passed=2)
2253
2254 def test_scope_session(self, pytester: Pytester) -> None:
2255 pytester.makepyfile(
2256 """
2257 import pytest
2258 values = []
2259 @pytest.fixture(scope="module")
2260 def arg():
2261 values.append(1)
2262 return 1
2263
2264 def test_1(arg):
2265 assert arg == 1
2266 def test_2(arg):
2267 assert arg == 1
2268 assert len(values) == 1
2269 class TestClass(object):
2270 def test3(self, arg):
2271 assert arg == 1
2272 assert len(values) == 1
2273 """
2274 )
2275 reprec = pytester.inline_run()
2276 reprec.assertoutcome(passed=3)
2277
2278 def test_scope_session_exc(self, pytester: Pytester) -> None:
2279 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