Change in vdsm[master]: Tests: log actual exceptions in RollbackContext

vvolansk at redhat.com vvolansk at redhat.com
Wed May 28 10:40:00 UTC 2014


Vered Volansky has uploaded a new change for review.

Change subject: Tests: log actual exceptions in RollbackContext
......................................................................

Tests: log actual exceptions in RollbackContext

When a wrong exception is thrown, the alert to this fact now contains
the actual exception that's been raised.

Change-Id: I3e8244f2b6ede47967025eb35e54ee2401fec30b
Signed-off-by: Vered Volansky <vvolansk at redhat.com>
---
M tests/utilsTests.py
1 file changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/75/28175/1

diff --git a/tests/utilsTests.py b/tests/utilsTests.py
index b799ee9..a7bfd60 100644
--- a/tests/utilsTests.py
+++ b/tests/utilsTests.py
@@ -407,8 +407,8 @@
         except RuntimeError:
             self.assertEquals(self._called, 3)
             return
-        except Exception:
-            self.fail("Wrong exception was raised")
+        except Exception as e:
+            self.fail("Wrong exception was raised - %s" % e)
 
         self.fail("Exception was not raised")
 
@@ -422,8 +422,8 @@
                 {}['aKey']
         except KeyError:
             pass
-        except Exception:
-            self.fail("Wrong exception was raised")
+        except Exception as e:
+            self.fail("Wrong exception was raised - %s" % e)
         else:
             self.fail("Exception was not raised")
 
@@ -444,8 +444,8 @@
         except self.UndoException:
             self.fail("Wrong exception was raised - from undo function. \
                         should have re-raised OriginalException")
-        except Exception:
-            self.fail("Wrong exception was raised")
+        except Exception as e:
+            self.fail("Wrong exception was raised - %s" % e)
         else:
             self.fail("Exception was not raised")
 


-- 
To view, visit http://gerrit.ovirt.org/28175
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3e8244f2b6ede47967025eb35e54ee2401fec30b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vered Volansky <vvolansk at redhat.com>


More information about the vdsm-patches mailing list