Commit 2704dd5a authored by Vincent Pelletier's avatar Vincent Pelletier

Simplify test code.

"except: raise" is a no-pop.
"try:... except: self.fail()" just hides the actual exception.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43397 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7dd97aa2
...@@ -148,9 +148,6 @@ class TestDeferredConnection(ERP5TypeTestCase): ...@@ -148,9 +148,6 @@ class TestDeferredConnection(ERP5TypeTestCase):
except OperationalError, m: except OperationalError, m:
if m[0] not in hosed_connection: if m[0] not in hosed_connection:
raise raise
except:
raise # Make sure the test is known to have failed, even if it's not
# the expected execution path.
else: else:
self.fail() self.fail()
finally: finally:
...@@ -168,14 +165,7 @@ class TestDeferredConnection(ERP5TypeTestCase): ...@@ -168,14 +165,7 @@ class TestDeferredConnection(ERP5TypeTestCase):
# Artificially cause a connection close. # Artificially cause a connection close.
self.monkeypatchConnection(connection) self.monkeypatchConnection(connection)
try: try:
try: transaction.commit()
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.
finally: finally:
self.unmonkeypatchConnection(connection) self.unmonkeypatchConnection(connection)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment