I'd like to run doctests for a set of modules (glob: invenio.webtag*) from a single module, but I'll need a way to import all these (and only these) modules and run doctest.testmod() on all of them. Any ideas?
Edit: The solution:
import doctest
import glob
import os
import pkgutil
pkgpath = pkgutil.extend_path([], 'invenio')[0]
for module_path in glob.glob(pkgpath + '/webtag*.py'):
module_name = os.path.splitext(os.path.basename(module_path))[0]
module = __import__('invenio.' + module_name)
doctest.testmod(module)