From 98843d8a152645d97ac9bf6895bf2137db01502c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Tue, 14 Jun 2005 11:39:50 +0000 Subject: [PATCH] =?UTF-8?q?Dilerseniz=20testleri=20tek=20tek=20de=20=C3=A7?= =?UTF-8?q?al=C4=B1=C5=9Ft=C4=B1rabilirsiniz.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit unittests/run.py specfiletests archivetests veya hepsini çalıştırmak için (eskisi gibi) unittests/run.py --- src/unittests/run.py | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/unittests/run.py b/src/unittests/run.py index 10cf8699..4830b399 100755 --- a/src/unittests/run.py +++ b/src/unittests/run.py @@ -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()