Test start / stop. And check if the mocked function is really called

This commit is contained in:
Julien Duponchelle
2015-01-21 17:11:21 +01:00
parent 87a089457f
commit ce9fd3cb25
4 changed files with 15 additions and 10 deletions

View File

@ -39,7 +39,8 @@ class _asyncio_patch:
def __enter__(self):
"""Used when enter in the with block"""
self._patcher = patch(self.function, return_value=self._fake_anwser())
self._patcher.start()
mock_class = self._patcher.start()
return mock_class
def __exit__(self, *exc_info):
"""Used when leaving the with block"""