require options '-v' or '-vv' for status output in test runner
authorStefan Behnel <scoder@users.berlios.de>
Sun, 25 May 2008 13:49:59 +0000 (15:49 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Sun, 25 May 2008 13:49:59 +0000 (15:49 +0200)
runtests.py

index fa7c7310ac067b6658e384a7d151b357a6bac920..c4216ef465130799a8f022b2ea66a40307ecb5f4 100644 (file)
@@ -282,6 +282,18 @@ if __name__ == '__main__':
     else:
         annotate_source = True
 
+    try:
+        sys.argv.remove("-vv")
+    except ValueError:
+        try:
+            sys.argv.remove("-v")
+        except ValueError:
+            verbosity = 0
+        else:
+            verbosity = 1
+    else:
+        verbosity = 2
+
     import re
     selectors = [ re.compile(r, re.I|re.U).search for r in sys.argv[1:] ]
     if not selectors:
@@ -293,7 +305,7 @@ if __name__ == '__main__':
     if coverage is not None:
         coverage.start()
 
-    unittest.TextTestRunner(verbosity=2).run(test_suite)
+    unittest.TextTestRunner(verbosity=verbosity).run(test_suite)
 
     if coverage is not None:
         coverage.stop()