[Erp5-report] r43397 vincent - /erp5/trunk/products/ZMySQLDDA/tests/testDeferredConnection.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Feb 17 07:55:01 CET 2011
Author: vincent
Date: Thu Feb 17 07:55:01 2011
New Revision: 43397
URL: http://svn.erp5.org?rev=43397&view=rev
Log:
Simplify test code.
"except: raise" is a no-pop.
"try:... except: self.fail()" just hides the actual exception.
Modified:
erp5/trunk/products/ZMySQLDDA/tests/testDeferredConnection.py
Modified: erp5/trunk/products/ZMySQLDDA/tests/testDeferredConnection.py
URL: http://svn.erp5.org/erp5/trunk/products/ZMySQLDDA/tests/testDeferredConnection.py?rev=43397&r1=43396&r2=43397&view=diff
==============================================================================
--- erp5/trunk/products/ZMySQLDDA/tests/testDeferredConnection.py [utf8] (original)
+++ erp5/trunk/products/ZMySQLDDA/tests/testDeferredConnection.py [utf8] Thu Feb 17 07:55:01 2011
@@ -148,9 +148,6 @@ class TestDeferredConnection(ERP5TypeTes
except OperationalError, m:
if m[0] not in hosed_connection:
raise
- except:
- raise # Make sure the test is known to have failed, even if it's not
- # the expected execution path.
else:
self.fail()
finally:
@@ -168,14 +165,7 @@ class TestDeferredConnection(ERP5TypeTes
# Artificially cause a connection close.
self.monkeypatchConnection(connection)
try:
- try:
- transaction.commit()
- except OperationalError, m:
- LOG('TestDeferredConnection', 0, 'OperationalError exception raised: %s' % (m, ))
- self.fail()
- except:
- raise # Make sure the test is known to have failed, even if it's not
- # the expected execution path.
+ transaction.commit()
finally:
self.unmonkeypatchConnection(connection)
More information about the Erp5-report
mailing list