def test_fixture_double_decorator(pytester: Pytester) -> None:
    """Check if an error is raised when using @pytest.fixture twice."""
    pytester.makepyfile(
        """
        import pytest

        @pytest.fixture
        @pytest.fixture
        def fixt():
            pass
        """
    )
    result = pytester.runpytest()
    result.assert_outcomes(errors=1)
    result.stdout.fnmatch_lines(
        [
            "E * ValueError: @pytest.fixture is being applied more than once to the same function 'fixt'"
        ]
    )
Check if an error is raised when using @pytest.fixture twice.
testing/python/fixtures.py