[Python-checkins] r58539 - python/trunk/Lib/bsddb/test/test_1413192.py

gregory.p.smith python-checkins at python.org
Fri Oct 19 09:31:20 CEST 2007


Author: gregory.p.smith
Date: Fri Oct 19 09:31:20 2007
New Revision: 58539

Modified:
   python/trunk/Lib/bsddb/test/test_1413192.py
Log:
squelch the warning that this test is supposed to trigger.


Modified: python/trunk/Lib/bsddb/test/test_1413192.py
==============================================================================
--- python/trunk/Lib/bsddb/test/test_1413192.py	(original)
+++ python/trunk/Lib/bsddb/test/test_1413192.py	Fri Oct 19 09:31:20 2007
@@ -5,6 +5,7 @@
 
 import shutil
 import tempfile
+import warnings
 try:
     # For Pythons w/distutils and add-on pybsddb
     from bsddb3 import db
@@ -32,8 +33,12 @@
         del self.the_txn
 
 
-context = Context()
-del context
+warnings.filterwarnings('ignore', 'DBTxn aborted in destructor')
+try:
+    context = Context()
+    del context
+finally:
+    warnings.resetwarnings()
 
 # try not to leave a turd
 try:


More information about the Python-checkins mailing list