[Zope-Checkins] SVN: Zope/branches/2.12/src/Products/Five/tests/test_security.py Suppress and test expected warnings emitted by ZCML class-requires.

2010-06-15 Thread Tres Seaver
Log message for revision 113494:
  Suppress and test expected warnings emitted by ZCML class-requires.

Changed:
  U   Zope/branches/2.12/src/Products/Five/tests/test_security.py

-=-
Modified: Zope/branches/2.12/src/Products/Five/tests/test_security.py
===
--- Zope/branches/2.12/src/Products/Five/tests/test_security.py 2010-06-15 
15:11:41 UTC (rev 113493)
+++ Zope/branches/2.12/src/Products/Five/tests/test_security.py 2010-06-15 
16:33:53 UTC (rev 113494)
@@ -276,7 +276,17 @@
   Running this should not throw an exception (but will print a warning to
   stderr)
   
-   zcml.load_string(configure_zcml)
+   from warnings import catch_warnings
+   warned = []
+   with catch_warnings(record=True) as trapped:
+  ...  zcml.load_string(configure_zcml)
+  ...  warned.extend(list(trapped))
+   len(warned)
+  2
+   str(warned[0].message)
+  'The set_schema option...'
+   str(warned[1].message)
+  'The set_attribute option...'
tearDown()
 
 

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


[Zope-Checkins] SVN: Zope/trunk/src/AccessControl/tests/testZCML.py Suppress and test expected warnings emitted by ZCML class-requires.

2010-06-15 Thread Tres Seaver
Log message for revision 113496:
  Suppress and test expected warnings emitted by ZCML class-requires.

Changed:
  U   Zope/trunk/src/AccessControl/tests/testZCML.py

-=-
Modified: Zope/trunk/src/AccessControl/tests/testZCML.py
===
--- Zope/trunk/src/AccessControl/tests/testZCML.py  2010-06-15 16:35:35 UTC 
(rev 113495)
+++ Zope/trunk/src/AccessControl/tests/testZCML.py  2010-06-15 16:40:32 UTC 
(rev 113496)
@@ -209,8 +209,18 @@
   Running this should not throw an exception (but will print a warning to
   stderr)
 
+   from warnings import catch_warnings
from zope.configuration.xmlconfig import xmlconfig
-   xmlconfig(configure_zcml)
+   warned = []
+   with catch_warnings(record=True) as trapped:
+  ...  xmlconfig(configure_zcml)
+  ...  warned.extend(list(trapped))
+   len(warned)
+  2
+   str(warned[0].message)
+  'The set_schema option...'
+   str(warned[1].message)
+  'The set_attribute option...'
tearDown()
 
 
@@ -385,4 +395,4 @@
 
 def test_suite():
 import doctest
-return doctest.DocTestSuite()
+return doctest.DocTestSuite(optionflags=doctest.ELLIPSIS)

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