From 44952520412d6436754eb9786c023d4769abb20b Mon Sep 17 00:00:00 2001 From: Ricardo Vieira Date: Fri, 13 Dec 2024 10:52:55 +0100 Subject: [PATCH] Make mlflow test optional --- pyproject.toml | 3 +++ tests/test_mlflow.py | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a1fe3c508..711dada7a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -136,6 +136,9 @@ ignore = [ "D", "S101", # Use of assert ] +"tests/test_mlflow.py" = [ + "E402", # Module level import not at top of file. Needed for importorskip +] "scripts/*" = ["D"] [tool.ruff.lint.pycodestyle] diff --git a/tests/test_mlflow.py b/tests/test_mlflow.py index 8e7d1a25b..7d5028b8d 100644 --- a/tests/test_mlflow.py +++ b/tests/test_mlflow.py @@ -11,13 +11,16 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +import pytest + +mlflow = pytest.importorskip("mlflow") + import json import logging from collections import namedtuple from pathlib import Path import arviz as az -import mlflow import numpy as np import pandas as pd import pymc as pm