def test_collect_module_two_doctest_no_modulelevel(self, testdir):
    path = testdir.makepyfile(whatever='\n            \'# Empty\'\n            def my_func():\n                ">>> magic = 42 "\n            def unuseful():\n                \'\'\'\n                # This is a function\n                # >>> # it doesn\'t have any doctest\n                \'\'\'\n            def another():\n                \'\'\'\n                # This is another function\n                >>> import os # this one does have a doctest\n                \'\'\'\n        ')
    for p in (path, testdir.tmpdir):
        (items, reprec) = testdir.inline_genitems(p, '--doctest-modules')
        assert (len(items) == 2)
        assert isinstance(items[0], DoctestItem)
        assert isinstance(items[1], DoctestItem)
        assert isinstance(items[0].parent, DoctestModule)
        assert (items[0].parent is items[1].parent)
def test_collect_module_two_doctest_no_modulelevel(self, testdir):
    path = testdir.makepyfile(whatever='\n            \'# Empty\'\n            def my_func():\n                ">>> magic = 42 "\n            def unuseful():\n                \'\'\'\n                # This is a function\n                # >>> # it doesn\'t have any doctest\n                \'\'\'\n            def another():\n                \'\'\'\n                # This is another function\n                >>> import os # this one does have a doctest\n                \'\'\'\n        ')
    for p in (path, testdir.tmpdir):
        (items, reprec) = testdir.inline_genitems(p, '--doctest-modules')
        assert (len(items) == 2)
        assert isinstance(items[0], DoctestItem)
        assert isinstance(items[1], DoctestItem)
        assert isinstance(items[0].parent, DoctestModule)
        assert (items[0].parent is items[1].parent)