Skip to content

Commit

Permalink
[DEBUG] Add fixtures in conftest
Browse files Browse the repository at this point in the history
  • Loading branch information
rmccorm4 committed Nov 4, 2024
1 parent 1914c71 commit 229fd0b
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import os
import sys
from pathlib import Path

sys.path.append(os.path.join(Path(__file__).resolve().parent, ".."))
import pytest
from tests.utils import ScopedTritonServer


@pytest.fixture(scope="function")
def llm_server():
llm_repo = None

# Give ample startup timeout for possible downloading of models
server = ScopedTritonServer(repo=llm_repo, timeout=600)
yield server
# Ensure server is cleaned up after each test
server.stop()


@pytest.fixture(scope="function")
def simple_server():
test_dir = os.path.dirname(os.path.realpath(__file__))
simple_repo = os.path.join(test_dir, "test_models")

server = ScopedTritonServer(repo=simple_repo)
yield server
# Ensure server is cleaned up after each test
server.stop()

0 comments on commit 229fd0b

Please sign in to comment.