changeset 350:ae6605eccd09

Can give test name in debug mode. This will execute on the gived test name.
author Frederic Bastien <bastienf@iro.umontreal.ca>
date Tue, 17 Jun 2008 16:20:17 -0400
parents 2174fe5cc7d0
children 7545207466d4
files _test_dataset.py
diffstat 1 files changed, 13 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/_test_dataset.py	Tue Jun 17 16:09:59 2008 -0400
+++ b/_test_dataset.py	Tue Jun 17 16:20:17 2008 -0400
@@ -663,14 +663,19 @@
         res = dsc[:]
 
 if __name__=='__main__':
-    if len(sys.argv)==2:
-        if sys.argv[1]=="--debug":
+    tests = [] #'test_RenamedFieldsDataSet']
+#    unittest.TestSuite(map(T_DataSet, tests)).debug()
+#    sys.exit()
+    debug=False
+    if len(sys.argv)==1:
+        unittest.main()
+    else:
+        assert sys.argv[1]=="--debug"
+        for arg in sys.argv[2:]:
+            tests.append(arg)
+        if tests:
+            unittest.TestSuite(map(T_DataSet, tests)).debug()
+        else:
             module = __import__("_test_dataset")
             tests = unittest.TestLoader().loadTestsFromModule(module)
             tests.debug()
-        print "bad argument: only --debug is accepted"
-    elif len(sys.argv)==1:
-        unittest.main()
-    else:
-        print "bad argument: only --debug is accepted"
-