Apply all of the patches that have been specified with L{addPatch}. Reverse this operation using L{restore}.
(self)
| 39 | return False |
| 40 | |
| 41 | def patch(self): |
| 42 | """ |
| 43 | Apply all of the patches that have been specified with L{addPatch}. |
| 44 | Reverse this operation using L{restore}. |
| 45 | """ |
| 46 | for obj, name, value in self._patchesToApply: |
| 47 | if not self._alreadyPatched(obj, name): |
| 48 | self._originals.append((obj, name, getattr(obj, name))) |
| 49 | setattr(obj, name, value) |
| 50 | |
| 51 | __enter__ = patch |
| 52 |