MCPcopy
hub / github.com/pytest-dev/pytest / test_func_closure_module

Method test_func_closure_module

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

Source from the content-addressed store, hash-verified

4644 result.assert_outcomes(passed=1)
4645
4646 def test_func_closure_module(self, pytester: Pytester) -> None:
4647 pytester.makepyfile(
4648 """
4649 import pytest
4650
4651 @pytest.fixture(scope='module')
4652 def m1(): pass
4653
4654 @pytest.fixture(scope='function')
4655 def f1(): pass
4656
4657 def test_func(f1, m1):
4658 pass
4659 """
4660 )
4661 items, _ = pytester.inline_genitems()
4662 assert isinstance(items[0], Function)
4663 request = TopRequest(items[0], _ispytest=True)
4664 assert request.fixturenames == "m1 f1".split()
4665
4666 def test_func_closure_scopes_reordered(self, pytester: Pytester) -> None:
4667 """Test ensures that fixtures are ordered by scope regardless of the order of the parameters, although

Callers

nothing calls this directly

Calls 3

TopRequestClass · 0.90
makepyfileMethod · 0.45
inline_genitemsMethod · 0.45

Tested by

no test coverage detected