def test_parametrize_overrides_indirect_dependency_fixture(
        self, pytester: Pytester
    ) -> None:
        """Test parametrization when parameter overrides a fixture that a test indirectly depends on"""
        pytester.makepyfile(
            """
            import pytest

            fix3_instantiated = False

            @pytest.fixture
            def fix1(fix2):
               return fix2 + '1'

            @pytest.fixture
            def fix2(fix3):
               return fix3 + '2'

            @pytest.fixture
            def fix3():
               global fix3_instantiated
               fix3_instantiated = True
               return '3'

            @pytest.mark.parametrize('fix2', ['2'])
            def test_it(fix1):
               assert fix1 == '21'
               assert not fix3_instantiated
        """
        )
        rec = pytester.inline_run()
        rec.assertoutcome(passed=1)
Test parametrization when parameter overrides a fixture that a test indirectly depends on
testing/python/collect.py