[Zope-Checkins] SVN: Zope/trunk/test.py Implemented --nowarnings
	flag for the "new" test runner.
    Stefan H. Holek 
    stefan at epy.co.at
       
    Tue May  9 07:30:28 EDT 2006
    
    
  
Log message for revision 68066:
  Implemented --nowarnings flag for the "new" test runner.
  
Changed:
  U   Zope/trunk/test.py
-=-
Modified: Zope/trunk/test.py
===================================================================
--- Zope/trunk/test.py	2006-05-09 11:30:13 UTC (rev 68065)
+++ Zope/trunk/test.py	2006-05-09 11:30:28 UTC (rev 68066)
@@ -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