Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions tests/integration/endpoints/test_model_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,14 @@ async def test_models_list_on_api_connection_error(
_ = mock_llama_stack_client_failing

# we should catch HTTPException, not APIConnectionError!
expected = "503: {'response': 'Unable to connect to Llama Stack', 'cause': 'Connection error.'}"
with pytest.raises(HTTPException, match=expected):
with pytest.raises(HTTPException) as exc_info:
await models_endpoint_handler(
request=test_request,
auth=test_auth,
model_type=ModelFilter(model_type=None),
)

assert exc_info.value.status_code == 503
assert isinstance(exc_info.value.detail, dict)
assert exc_info.value.detail["response"] == "Unable to connect to Llama Stack"
assert "cause" in exc_info.value.detail
7 changes: 6 additions & 1 deletion tests/integration/endpoints/test_rlsapi_v1_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,12 @@ async def test_rlsapi_v1_infer_input_source_combination(
call_args = mock_responses.create.call_args
input_content = call_args.kwargs["input"]

for expected in ["My question", "stdin content", "attachment content", "terminal"]:
for expected in [
"My question",
"stdin content",
"attachment content",
"terminal output",
]:
assert expected in input_content


Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_default_configuration() -> None:
cfg = configuration
assert cfg is not None
with pytest.raises(Exception, match="logic error: configuration is not loaded"):
configuration.configuration # pylint: disable=pointless-statement
_ = configuration.configuration


def test_loading_proper_configuration(configuration_filename: str) -> None:
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_openapi_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def _load_openapi_spec_from_file() -> dict[str, Any]:
return json.load(f)

pytest.fail("OpenAPI spec not found")
return {}
return {} # pragma: no cover


def _load_openapi_spec_from_url() -> dict[str, Any]:
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_rh_identity_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def client() -> Generator[TestClient, None, None]:
yield TestClient(app)

# Restore original env var
if original_config:
if original_config is not None:
os.environ["LIGHTSPEED_STACK_CONFIG_PATH"] = original_config
else:
os.environ.pop("LIGHTSPEED_STACK_CONFIG_PATH", None)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def read_version_from_pyproject() -> str:
# it is not safe to just try to read version from pyproject.toml file directly
# the PDM tool itself is able to retrieve the version, even if the version
# is generated dynamically
completed = subprocess.run( # noqa: S603
completed = subprocess.run(
["pdm", "show", "--version"], # noqa: S607
capture_output=True,
check=True,
Expand Down
Loading