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

            @pytest.fixture(autouse=True, scope="{scope}")
            def auto(request):
                return 99
        """
        )
        pytester.makepyfile(
            test_1='''
            def test_foo():
                """
                >>> getfixture('auto') + 1
                100
                """
            def test_bar():
                assert 1
        '''
        )
        params = ("--doctest-modules",) if enable_doctest else ()
        passes = 3 if enable_doctest else 2
        result = pytester.runpytest(*params)
        result.stdout.fnmatch_lines([f"*=== {passes} passed in *"])
Test that auto-use fixtures work properly with doctest modules.
        See #1057 and #1100.
        
testing/test_doctest.py