Skip to content

Commit

Permalink
TST: Improve MultiPatcher interface
Browse files Browse the repository at this point in the history
  • Loading branch information
cortadocodes committed Jul 27, 2023
1 parent 96b0778 commit baa6133
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion octue/utils/patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,18 @@ def __enter__(self):
:return list(unittest.mock.MagicMock):
"""
return [patch.start() for patch in self.patches]
return self.start()

def __exit__(self, *args, **kwargs):
"""Stop the patches.
:return None:
"""
self.stop()

def start(self):
return [patch.start() for patch in self.patches]

def stop(self):
for patch in self.patches:
patch.stop()

0 comments on commit baa6133

Please sign in to comment.