===================================================================================== FAILURES ======================================================================================
______________________________________________________________________ test_wrong_type_except_save_authors_err ______________________________________________________________________
self = <except_deco.repository.AuthorRepository object at 0x106b25c60>, args = ([None, None, None],), kwargs = {}
@wraps(func)
def wrapper(self: ABCRepository, *args, **kwargs) -> Any:
try:
> return func(self, *args, **kwargs)
except_deco/deco.py:11:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <except_deco.repository.AuthorRepository object at 0x106b25c60>, authors = [None, None, None]
@wrong_deco_add_model_cls_info_to_except
def save_authors_with_bad_deco(self, authors: List[AuthorEntity]) -> None:
> return self.save_entities(authors)
except_deco/repository.py:39:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <except_deco.repository.AuthorRepository object at 0x106b25c60>, authors = [None, None, None]
def save_entities(self, authors: List[BaseAppEntity]) -> None:
if not all(isinstance(a, BaseAppEntity) for a in authors):
> raise TypeError('Authors must be contain instance of BaseModel')
E TypeError: Authors must be contain instance of BaseModel
except_deco/repository.py:25: TypeError
The above exception was the direct cause of the following exception:
authors_repo = <except_deco.repository.AuthorRepository object at 0x106b25c60>
def test_wrong_type_except_save_authors_err(authors_repo):
with pytest.raises(TypeError):
> authors_repo.save_authors_with_bad_deco([None, None, None])
except_deco/test_repo.py:12:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <except_deco.repository.AuthorRepository object at 0x106b25c60>, args = ([None, None, None],), kwargs = {}
@wraps(func)
def wrapper(self: ABCRepository, *args, **kwargs) -> Any:
try:
return func(self, *args, **kwargs)
except Exception as ex:
> raise Exception(f'Repository exception from {self._model_cls}. {ex}') from ex
E Exception: Repository exception from <class 'except_deco.entity.AuthorEntity'>. Authors must be contain instance of BaseModel
except_deco/deco.py:13: Exception
============================================================================== short test summary info ==============================================================================
FAILED except_deco/test_repo.py::test_wrong_type_except_save_authors_err - Exception: Repository exception from <class 'except_deco.entity.AuthorEntity'>. Authors must be contain..