diff --git a/lenskit/lenskit/testing/_components.py b/lenskit/lenskit/testing/_components.py index 1b6d2e19a..7338f61b9 100644 --- a/lenskit/lenskit/testing/_components.py +++ b/lenskit/lenskit/testing/_components.py @@ -61,11 +61,14 @@ class TrainingTests: needs_jit: ClassVar[bool] = True component: type[Component] - @fixture(scope="function" if retrain else "class") - def trained_model(self, ml_ds: Dataset): + def maybe_skip_nojit(self): if self.needs_jit and not jit_enabled: skip("JIT is disabled") + @fixture(scope="function" if retrain else "class") + def trained_model(self, ml_ds: Dataset): + self.maybe_skip_nojit() + model = self.component() if isinstance(model, Trainable): model.train(ml_ds) @@ -218,6 +221,7 @@ def test_score_empty_items( def test_train_score_items_missing_data(self, rng: np.random.Generator, ml_ds: Dataset): "train and score when some entities are missing data" + self.maybe_skip_nojit() drop_i = rng.choice(ml_ds.items.ids(), 20) drop_u = rng.choice(ml_ds.users.ids(), 5)