Skip to content

Commit

Permalink
Non-recursive module finder
Browse files Browse the repository at this point in the history
  • Loading branch information
padix-key committed Mar 18, 2019
1 parent 61984fc commit d0424a3
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions tests/test_doctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def test_doctest(package_name, context_package_names):
globs = {}
mod_names = []
#The package itself is also used as context
print(package_name)
for name in context_package_names + [package_name]:
context_package = import_module(name)
mod_names += _list_modules(context_package, False)
Expand Down Expand Up @@ -100,9 +99,7 @@ def _list_modules(package, recursive):
Recursively list module names.
"""
modnames = []
print(package.__path__)
for finder, modname, ispkg in pkgutil.walk_packages(package.__path__):
print(modname, ispkg)
for finder, modname, ispkg in pkgutil.iter_modules(package.__path__):
abs_modname = f"{package.__name__}.{modname}"
if ispkg:
if recursive:
Expand Down

0 comments on commit d0424a3

Please sign in to comment.