in testslide/__init__.py [0:0]
def _init_mocks(self) -> None:
self.mock_callable = testslide.mock_callable.mock_callable
self.mock_async_callable = testslide.mock_callable.mock_async_callable
self.mock_constructor = testslide.mock_constructor.mock_constructor
self.patch_attribute = testslide.patch_attribute.patch_attribute
self._mock_callable_after_functions: List[Callable] = []
def register_assertion(assertion: Callable) -> None:
if self._example.is_async:
async def f(_: _ContextData) -> None:
assertion()
else:
f = lambda _: assertion()
self._mock_callable_after_functions.append(f)
testslide.mock_callable.register_assertion = register_assertion