def test_fixture_order_respects_scope(pytester: Pytester) -> None:
    """Ensure that fixtures are created according to scope order (#2405)."""
    pytester.makepyfile(
        """
        import pytest

        data = {}

        @pytest.fixture(scope='module')
        def clean_data():
            data.clear()

        @pytest.fixture(autouse=True)
        def add_data():
            data.update(value=True)

        @pytest.mark.usefixtures('clean_data')
        def test_value():
            assert data.get('value')
    """
    )
    result = pytester.runpytest()
    assert result.ret == 0
Ensure that fixtures are created according to scope order (#2405).
testing/acceptance_test.py