Change in vdsm[master]: tests: Add assertNotRaises assertion

nsoffer at redhat.com nsoffer at redhat.com
Thu May 29 21:44:07 UTC 2014


Nir Soffer has posted comments on this change.

Change subject: tests: Add assertNotRaises assertion
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.ovirt.org/#/c/28177/1/tests/testrunner.py
File tests/testrunner.py:

Line 180:             return context
Line 181:         with context:
Line 182:             callableObj(*args, **kwargs)
Line 183: 
Line 184:     def assertNotRaises(self, excClass, callableObj=None, *args, **kwargs):
I think we should have a default excClass=Exception, since the semantics of "does not raise specific exception" are somewhat confusing. It is not clear what should happen if an expected exception is raised.

Or just remove the excClass parameter. I don't need for the current tests. I added it because the symmetry with assertRaises. Since this is not a library code, we can easily add this later if needed.
Line 185:         # This is required when exception raised during the call should be
Line 186:         # considered as a test failure.
Line 187:         context = not_raises(excClass, self)
Line 188:         if callableObj is None:


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I33c96ca855753a75ffe2f82bdecab2e1612da08a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi at redhat.com>
Gerrit-Reviewer: Xavi Francisco <xfrancis at redhat.com>
Gerrit-Reviewer: Yoav Kleinberger <ykleinbe at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list