Change in vdsm[master]: tests: Add Patch class for fixture monkey patching

danken at redhat.com danken at redhat.com
Mon Oct 14 13:35:16 UTC 2013


Dan Kenigsberg has submitted this change and it was merged.

Change subject: tests: Add Patch class for fixture monkey patching
......................................................................


tests: Add Patch class for fixture monkey patching

MonkeyPatch decorator is useful when you want to monkey patch some
modules during one test and use different or no monkey patcing during
other tests.  However, when monkey patching all methods in a test case
class, using a decorator is tedious, leads to duplicate code and hamper
readability.

This patch adds a Patch object for monkey patching during all tests in a
test fixture. New tests cover both MonkeyPatch decorator and new Patch
object and serve as example code.

Change-Id: Idd419377be951635fe7d10cb21c0d1195e88cf8d
Signed-off-by: Nir Soffer <nsoffer at redhat.com>
Reviewed-on: http://gerrit.ovirt.org/19881
Reviewed-by: Allon Mureinik <amureini at redhat.com>
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
---
M tests/Makefile.am
M tests/monkeypatch.py
A tests/monkeypatchTests.py
3 files changed, 176 insertions(+), 8 deletions(-)

Approvals:
  Nir Soffer: Verified
  Allon Mureinik: Looks good to me, but someone else must approve
  Dan Kenigsberg: Looks good to me, approved



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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idd419377be951635fe7d10cb21c0d1195e88cf8d
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server


More information about the vdsm-patches mailing list