Dilerseniz testleri tek tek de çalıştırabilirsiniz.
unittests/run.py specfiletests archivetests veya hepsini çalıştırmak için (eskisi gibi) unittests/run.py
This commit is contained in:
+18
-6
@@ -4,18 +4,30 @@ import unittest
|
||||
import sys
|
||||
sys.path.append(".")
|
||||
|
||||
import specfiletests
|
||||
import fetchertests
|
||||
import archivetests
|
||||
runTestSuite = lambda(x): unittest.TextTestRunner(verbosity=2).run(x)
|
||||
|
||||
def run_all():
|
||||
import specfiletests
|
||||
import fetchertests
|
||||
import archivetests
|
||||
|
||||
def main():
|
||||
alltests = unittest.TestSuite((
|
||||
specfiletests.suite,
|
||||
fetchertests.suite,
|
||||
archivetests.suite
|
||||
))
|
||||
|
||||
unittest.TextTestRunner(verbosity=2).run(alltests)
|
||||
runTestSuite(alltests)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
args = sys.argv
|
||||
if len(args) > 1: # run modules given from the command line
|
||||
tests = sys.argv[1:]
|
||||
for test in tests:
|
||||
module = __import__(test)
|
||||
print "\nRunning tests in '%s'...\n" % (test)
|
||||
runTestSuite(module.suite)
|
||||
|
||||
else: # run all tests
|
||||
print "\nRunning all test in an order...\n"
|
||||
run_all()
|
||||
|
||||
Reference in New Issue
Block a user