diff --git a/tests/integration/endpoints/test_model_list.py b/tests/integration/endpoints/test_model_list.py index 27a984a99..b1cbe2e5c 100644 --- a/tests/integration/endpoints/test_model_list.py +++ b/tests/integration/endpoints/test_model_list.py @@ -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 diff --git a/tests/integration/endpoints/test_rlsapi_v1_integration.py b/tests/integration/endpoints/test_rlsapi_v1_integration.py index 38776949c..f99389a9b 100644 --- a/tests/integration/endpoints/test_rlsapi_v1_integration.py +++ b/tests/integration/endpoints/test_rlsapi_v1_integration.py @@ -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 diff --git a/tests/integration/test_configuration.py b/tests/integration/test_configuration.py index 60e6d09a6..93d53f289 100644 --- a/tests/integration/test_configuration.py +++ b/tests/integration/test_configuration.py @@ -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: diff --git a/tests/integration/test_openapi_json.py b/tests/integration/test_openapi_json.py index 53dbacc02..683d43cbd 100644 --- a/tests/integration/test_openapi_json.py +++ b/tests/integration/test_openapi_json.py @@ -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]: diff --git a/tests/integration/test_rh_identity_integration.py b/tests/integration/test_rh_identity_integration.py index 4aacbfd4b..e4f0ea87e 100644 --- a/tests/integration/test_rh_identity_integration.py +++ b/tests/integration/test_rh_identity_integration.py @@ -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) diff --git a/tests/integration/test_version.py b/tests/integration/test_version.py index 2e4255740..9330c67ee 100644 --- a/tests/integration/test_version.py +++ b/tests/integration/test_version.py @@ -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,