Re: [Zope-dev] Ignoring Warnings

2005-12-06 Thread Chris Withers

Dieter Maurer wrote:

A colleague of mine will be very happy:

  The hundreds of (mostly stupid deprecation) warnings prevent him
  to efficiently find the true problems in the test runner reports.

In principle, he could fix the warnings -- but they (mostly) come
not from our code but third party one. And, if possible, he
would perfer not to such third party code...


So be explicit about this and add warn filters to your zope.conf, they 
work just fine in testing. (I have a big chunk of them for Plohn 2.1 if 
you're interested)


Using the new option will mean you don't get any warnings of problems 
coming from your code :-(


Chris

--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Ignoring Warnings

2005-12-05 Thread Dieter Maurer
Chris Withers wrote at 2005-12-5 07:37 +:
>Great, so rather than fix the warnings, we add code to ignore them...

> Usage: ./bin/zopectl test --keepbytecode --nowarnings --dir Products/CMFPlone

A colleague of mine will be very happy:

  The hundreds of (mostly stupid deprecation) warnings prevent him
  to efficiently find the true problems in the test runner reports.

In principle, he could fix the warnings -- but they (mostly) come
not from our code but third party one. And, if possible, he
would perfer not to such third party code...


-- 
Dieter
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Ignoring Warnings

2005-12-05 Thread Chris Withers

Great, so rather than fix the warnings, we add code to ignore them...

*sigh*

Chris

Stefan H. Holek wrote:

Update of /cvs-repository/Zope
In directory cvs.zope.org:/tmp/cvs-serv6383

Modified Files:
  Tag: Zope-2_7-branch
	test.py 
Log Message:

Implemented a --nowarnings flag for test.py.
Makes running CMF and Plone tests a lot less annoying.

Usage: ./bin/zopectl test --keepbytecode --nowarnings --dir Products/CMFPlone


=== Zope/test.py 1.2.2.19 => 1.2.2.20 ===
--- Zope/test.py:1.2.2.19   Tue Oct  4 14:22:40 2005
+++ Zope/test.pySat Dec  3 09:31:33 2005
@@ -104,6 +104,9 @@
 Keep running the selected tests in a loop.  You may experience
 memory leakage.
 
+--nowarnings

+Install a filter to suppress warnings emitted by code.
+
 -t
 Time the individual tests and print a list of the top 50, sorted from
 longest to shortest.
@@ -740,6 +743,7 @@
 global test_dir
 global config_file
 global import_testing
+global no_warnings
 
 if argv is None:

 argv = sys.argv
@@ -767,11 +771,12 @@
 test_dir = None
 config_file = None
 import_testing = False
+now_warnings = False
 
 try:

 opts, args = getopt.getopt(argv[1:], "a:bcC:dDfg:G:hLmprtTuv",
["all", "help", "libdir=", "times=",
-"keepbytecode", "dir=", 
+"keepbytecode", "nowarnings", "dir=", 
 "config-file=", "import-testing"])

 except getopt.error, msg:
 print msg
@@ -843,6 +848,12 @@
 config_file = v
 elif k == '--import-testing':
 import_testing = True
+elif k == '--nowarnings':
+no_warnings = True
+
+if no_warnings:
+import warnings
+warnings.simplefilter('ignore', Warning, append=1)
 
 if gcthresh is not None:

 if gcthresh == 0:

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins



--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )