Skip to content

Commit

Permalink
ignore expected warnings in registration integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
mattf committed Jul 31, 2024
1 parent e46d14b commit 96e7db5
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions libs/ai-endpoints/tests/integration_tests/test_register_model.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import warnings
from typing import Any

import pytest
Expand Down Expand Up @@ -39,15 +40,14 @@ def test_registered_model_functional(
client: type, id: str, endpoint: str, contact_service: Any
) -> None:
model = Model(id=id, endpoint=endpoint)
with pytest.warns(
UserWarning
) as record: # warns because we're overriding known models
register_model(model)
contact_service(client(model=id))
assert len(record) == 2
assert isinstance(record[0].message, UserWarning)
assert "already registered" in str(record[0].message)
assert "Overriding" in str(record[0].message)
warnings.filterwarnings(
"ignore", r".*is already registered.*"
) # intentionally overridding known models
warnings.filterwarnings(
"ignore", r".*Unable to determine validity of.*"
) # we aren't passing client & type to Model()
register_model(model)
contact_service(client(model=id))


def test_registered_model_is_available() -> None:
Expand Down

0 comments on commit 96e7db5

Please sign in to comment.