@pytest.mark.parametrize('scope', SCOPES)
def test_namespace_pyfile(self, testdir, scope):
    '\n        Check that inserting something into the namespace works in a\n        simple Python file docstring doctest\n        '
    testdir.makeconftest('\n            import pytest\n            import contextlib\n\n            @pytest.fixture(autouse=True, scope="{scope}")\n            def add_contextlib(doctest_namespace):\n                doctest_namespace[\'cl\'] = contextlib\n        '.format(scope=scope))
    p = testdir.makepyfile("\n            def foo():\n                '''\n                >>> print(cl.__name__)\n                contextlib\n                '''\n        ")
    reprec = testdir.inline_run(p, '--doctest-modules')
    reprec.assertoutcome(passed=1)
Check that inserting something into the namespace works in a
simple Python file docstring doctest
@pytest.mark.parametrize('scope', SCOPES)
def test_namespace_pyfile(self, testdir, scope):
    '\n        Check that inserting something into the namespace works in a\n        simple Python file docstring doctest\n        '
    testdir.makeconftest('\n            import pytest\n            import contextlib\n\n            @pytest.fixture(autouse=True, scope="{scope}")\n            def add_contextlib(doctest_namespace):\n                doctest_namespace[\'cl\'] = contextlib\n        '.format(scope=scope))
    p = testdir.makepyfile("\n            def foo():\n                '\n                >>> print(cl.__name__)\n                contextlib\n                '\n        ")
    reprec = testdir.inline_run(p, '--doctest-modules')
    reprec.assertoutcome(passed=1)