bpo-36406: Handle namespace packages in doctest (GH-12520)

This commit is contained in:
Xtreak 2019-12-13 23:36:53 +05:30 committed by Brett Cannon
parent 025a602af7
commit 8289e27393
3 changed files with 8 additions and 2 deletions

View file

@ -701,8 +701,12 @@ class TestDocTestFinder(unittest.TestCase):
finally:
support.forget(pkg_name)
sys.path.pop()
assert doctest.DocTestFinder().find(mod) == []
include_empty_finder = doctest.DocTestFinder(exclude_empty=False)
exclude_empty_finder = doctest.DocTestFinder(exclude_empty=True)
self.assertEqual(len(include_empty_finder.find(mod)), 1)
self.assertEqual(len(exclude_empty_finder.find(mod)), 0)
def test_DocTestParser(): r"""
Unit tests for the `DocTestParser` class.