diff --git a/tests/models/test_serialization.py b/tests/models/test_serialization.py index e1f2ad11..febfc7fb 100644 --- a/tests/models/test_serialization.py +++ b/tests/models/test_serialization.py @@ -4,7 +4,13 @@ import pytest from implicit.als import AlternatingLeastSquares from implicit.nearest_neighbours import ItemItemRecommender -from lightfm import LightFM + +try: + from lightfm import LightFM +except ImportError: + LightFM = object # it's ok in case we're skipping the tests + +import sys from rectools.models import ( ImplicitALSWrapperModel, @@ -17,7 +23,11 @@ from .utils import get_final_successors -MODEL_CLASSES = [cls for cls in get_final_successors(ModelBase) if cls.__module__.startswith("rectools.models")] +MODEL_CLASSES = [ + cls + for cls in get_final_successors(ModelBase) + if cls.__module__.startswith("rectools.models") and not (sys.version_info >= (3, 12) and cls is LightFMWrapperModel) +] def init_default_model(model_cls: tp.Type[ModelBase]) -> ModelBase: