[Zope-Checkins] SVN: Zope/branches/2.9/test.py Implemented --nowarnings flag for the "new" test runner.

Stefan H. Holek stefan at epy.co.at
Tue May 9 07:30:13 EDT 2006


Log message for revision 68065:
  Implemented --nowarnings flag for the "new" test runner.
  

Changed:
  U   Zope/branches/2.9/test.py

-=-
Modified: Zope/branches/2.9/test.py
===================================================================
--- Zope/branches/2.9/test.py	2006-05-09 11:28:02 UTC (rev 68064)
+++ Zope/branches/2.9/test.py	2006-05-09 11:30:13 UTC (rev 68065)
@@ -99,4 +99,14 @@
 Initialize Zope with the given configuration file.
 """)
 
+def filter_warnings(option, opt, *ignored):
+    import warnings
+    warnings.simplefilter('ignore', Warning, append=True)
+
+testrunner.other.add_option(
+    '--nowarnings', action="callback", callback=filter_warnings,
+    help="""\
+Install a filter to suppress warnings emitted by code.
+""")
+
 sys.exit(testrunner.run(defaults))



More information about the Zope-Checkins mailing list