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

Method test_func_closure_module

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

Source from the content-addressed store, hash-verified

4043 assert FIXTURE_ORDER == "s1 my_tmp_path_factory p1 m1 my_tmp_path f1 f2".split()
4044
4045 def test_func_closure_module(self, pytester: Pytester) -> None:
4046 pytester.makepyfile(
4047 """
4048 import pytest
4049
4050 @pytest.fixture(scope='module')
4051 def m1(): pass
4052
4053 @pytest.fixture(scope='function')
4054 def f1(): pass
4055
4056 def test_func(f1, m1):
4057 pass
4058 """
4059 )
4060 items, _ = pytester.inline_genitems()
4061 request = FixtureRequest(items[0], _ispytest=True)
4062 assert request.fixturenames == "m1 f1".split()
4063
4064 def test_func_closure_scopes_reordered(self, pytester: Pytester) -> None:
4065 """Test ensures that fixtures are ordered by scope regardless of the order of the parameters, although

Callers

nothing calls this directly

Calls 3

FixtureRequestClass · 0.90
makepyfileMethod · 0.45
inline_genitemsMethod · 0.45

Tested by

no test coverage detected