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

        @pytest.fixture
        class A:
            pass
        """
    )
    result = pytester.runpytest()
    result.assert_outcomes(errors=1)
Check if an error is raised when using @pytest.fixture on a class.
testing/python/fixtures.py