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

Method test_setupcontext_no_param

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

Source from the content-addressed store, hash-verified

1074 reprec.assertoutcome(passed=1)
1075
1076 def test_setupcontext_no_param(self, pytester: Pytester) -> None:
1077 pytester.makepyfile(
1078 """
1079 import pytest
1080 @pytest.fixture(params=[1,2])
1081 def arg(request):
1082 return request.param
1083
1084 @pytest.fixture(autouse=True)
1085 def mysetup(request, arg):
1086 assert not hasattr(request, "param")
1087 def test_1(arg):
1088 assert arg in (1,2)
1089 """
1090 )
1091 reprec = pytester.inline_run()
1092 reprec.assertoutcome(passed=2)
1093
1094
1095class TestRequestSessionScoped:

Callers

nothing calls this directly

Calls 3

assertoutcomeMethod · 0.80
makepyfileMethod · 0.45
inline_runMethod · 0.45

Tested by

no test coverage detected