def test_parametrized_package_scope_reordering(self, pytester: Pytester) -> None:
        """A parameterized package-scoped fixture correctly reorders items to
        minimize setups & teardowns.

        Regression test for #12328.
        """
        pytester.makepyfile(
            __init__="",
            conftest="""
                import pytest
                @pytest.fixture(scope="package", params=["a", "b"])
                def fix(request):
                    return request.param
            """,
            test_1="def test1(fix): pass",
            test_2="def test2(fix): pass",
        )

        result = pytester.runpytest("--setup-plan")
        assert result.ret == ExitCode.OK
        result.stdout.fnmatch_lines(
            [
                "  SETUP    P fix['a']",
                "        test_1.py::test1[a] (fixtures used: fix, request)",
                "        test_2.py::test2[a] (fixtures used: fix, request)",
                "  TEARDOWN P fix['a']",
                "  SETUP    P fix['b']",
                "        test_1.py::test1[b] (fixtures used: fix, request)",
                "        test_2.py::test2[b] (fixtures used: fix, request)",
                "  TEARDOWN P fix['b']",
            ],
        )
A parameterized package-scoped fixture correctly reorders items to
        minimize setups & teardowns.

        Regression test for #12328.
        
testing/python/fixtures.py