From baa61339813244135a8fe322d79d09cb7a6918b9 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Thu, 27 Jul 2023 17:13:20 +0100 Subject: [PATCH] TST: Improve `MultiPatcher` interface --- octue/utils/patches.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/octue/utils/patches.py b/octue/utils/patches.py index 54883acff..340b5fb56 100644 --- a/octue/utils/patches.py +++ b/octue/utils/patches.py @@ -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()