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

Method test_request_is_clean

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

Source from the content-addressed store, hash-verified

2939 assert reprec.matchreport(test).passed
2940
2941 def test_request_is_clean(self, pytester: Pytester) -> None:
2942 pytester.makepyfile(
2943 """
2944 import pytest
2945 values = []
2946 @pytest.fixture(params=[1, 2])
2947 def fix(request):
2948 request.addfinalizer(lambda: values.append(request.param))
2949 def test_fix(fix):
2950 pass
2951 """
2952 )
2953 reprec = pytester.inline_run("-s")
2954 values = reprec.getcalls("pytest_runtest_call")[0].item.module.values
2955 assert values == [1, 2]
2956
2957 def test_parametrize_separated_lifecycle(self, pytester: Pytester) -> None:
2958 pytester.makepyfile(

Callers

nothing calls this directly

Calls 3

getcallsMethod · 0.80
makepyfileMethod · 0.45
inline_runMethod · 0.45

Tested by

no test coverage detected