def test_fixture_module_doctest_scopes(
        self, pytester, scope, autouse, use_fixture_in_doctest
    ):
        """Test that auto-use fixtures work properly with doctest files.
        See #1057 and #1100.
        """
        pytester.makeconftest(
            f"""
            import pytest

            @pytest.fixture(autouse={autouse}, scope="{scope}")
            def auto(request):
                return 99
        """
        )
        if use_fixture_in_doctest:
            pytester.maketxtfile(
                test_doc="""
                >>> getfixture('auto')
                99
            """
            )
        else:
            pytester.maketxtfile(
                test_doc="""
                >>> 1 + 1
                2
            """
            )
        result = pytester.runpytest("--doctest-modules")
        result.stdout.no_fnmatch_line("*FAILURES*")
        result.stdout.fnmatch_lines(["*=== 1 passed in *"])
Test that auto-use fixtures work properly with doctest files.
        See #1057 and #1100.
        
testing/test_doctest.py