Skip to content

Commit

Permalink
change to session fixture
Browse files Browse the repository at this point in the history
Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming committed Jan 19, 2024
1 parent 1245522 commit 425304f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions examples/monitoring/task_classification/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@
from bentoml._internal.configuration.containers import BentoMLContainer

if t.TYPE_CHECKING:
from _pytest.config import Config
from _pytest.fixtures import FixtureRequest
from _pytest.main import Session
from _pytest.nodes import Item
from _pytest.tmpdir import TempPathFactory

PROJECT_DIR = Path(__file__).parent.parent


def pytest_collection_modifyitems(session: Session, config: Config, items: list[Item]):
@pytest.fixture(scope="session", autouse=True)
def prepare_model() -> None:
try:
print(f"Found {bentoml.models.get('iris_clf')}, skipping model saving.")
except bentoml.exceptions.NotFound:
Expand Down

0 comments on commit 425304f

Please sign in to comment.