def test_namespace_doctestfile(self, pytester, scope):
        """
        Check that inserting something into the namespace works in a
        simple text file doctest
        """
        pytester.makeconftest(
            f"""
            import pytest
            import contextlib

            @pytest.fixture(autouse=True, scope="{scope}")
            def add_contextlib(doctest_namespace):
                doctest_namespace['cl'] = contextlib
        """
        )
        p = pytester.maketxtfile(
            """
            >>> print(cl.__name__)
            contextlib
        """
        )
        reprec = pytester.inline_run(p)
        reprec.assertoutcome(passed=1)

        Check that inserting something into the namespace works in a
        simple text file doctest
        
testing/test_doctest.py