def test_object_type_is_final():
object_types = set()
def check_final(cls):
if hasattr(cls, "object_type"):
assert cls.object_type not in object_types
object_types.add(cls.object_type)
if cls.__subclasses__():
assert not hasattr(cls, "object_type")
for subcls in cls.__subclasses__():
check_final(subcls)
> check_final(BaseModel)
.tox/py3-full/lib/python3.7/site-packages/swh/model/tests/test_model.py:1423:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3-full/lib/python3.7/site-packages/swh/model/tests/test_model.py:1421: in check_final
check_final(subcls)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'swh.model.model.Release'>
def check_final(cls):
if hasattr(cls, "object_type"):
> assert cls.object_type not in object_types
E AssertionError: assert 'release' not in {'directory', 'extid', 'origin', 'origin_visit', 'origin_visit_status', 'person', ...}
E + where 'release' = <class 'swh.model.model.Release'>.object_type
.tox/py3-full/lib/python3.7/site-packages/swh/model/tests/test_model.py:1416: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Jul 21 2022, 12:47 PM