[PATCH] silenttestrunner: add environment variable to make tests noisy again

Augie Fackler raf at durin42.com
Fri Nov 14 09:44:29 CST 2014


# HG changeset patch
# User Augie Fackler <augie at google.com>
# Date 1415911635 18000
#      Thu Nov 13 15:47:15 2014 -0500
# Node ID 787ccc893f1fe3fce36debddaa12d3223fa9efc5
# Parent  394c79df66c39923477528b2ea2092b6944b965b
silenttestrunner: add environment variable to make tests noisy again

As I've been working on complicated extension code it's been handy to
be able to get standard unittest verbose output so I can find crashers
more efficiently.

diff --git a/tests/silenttestrunner.py b/tests/silenttestrunner.py
--- a/tests/silenttestrunner.py
+++ b/tests/silenttestrunner.py
@@ -1,4 +1,4 @@
-import unittest, sys
+import unittest, sys, os
 
 def main(modulename):
     '''run the tests found in module, printing nothing when all tests pass'''
@@ -16,3 +16,6 @@ def main(modulename):
             print
             sys.stdout.write(exc)
         sys.exit(1)
+
+if os.environ.get('SILENT_BE_NOISY'):
+    main = unittest.main


More information about the Mercurial-devel mailing list