mirror of
https://github.com/kennethreitz/dive-into-python3.git
synced 2026-06-05 23:10:17 +00:00
regression tests
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import unittest
|
||||
import os
|
||||
import glob
|
||||
|
||||
def regressionTest():
|
||||
filenames = glob.glob('*test*.py')
|
||||
module_names = [os.path.splitext(os.path.basename(f))[0] for f in filenames]
|
||||
modules = [__import__(name) for name in module_names]
|
||||
tests = [unittest.defaultTestLoader.loadTestsFromModule(m) for m in modules]
|
||||
return unittest.TestSuite(tests)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main(defaultTest='regressionTest')
|
||||
Reference in New Issue
Block a user