def create_doctest_testsuite():
# gather information on doctests, search in only wradlib folder
root_dir = 'wradlib/'
files = []
skip = ['__init__.py', 'version.py', 'bufr.py', 'test_']
for root, _, filenames in os.walk(root_dir):
for filename in filenames:
if filename in skip or filename[-3:] != '.py':
continue
if 'wradlib/tests' in root:
continue
f = os.path.join(root, filename)
f = f.replace('/', '.')
f = f[:-3]
files.append(f)
# put modules in doctest suite
suite = unittest.TestSuite()
for module in files:
suite.addTest(doctest.DocTestSuite(module))
return suite
评论列表
文章目录