diff --git a/llama_stack/providers/tests/datasetio/test_datasetio.py b/llama_stack/providers/tests/datasetio/test_datasetio.py index cf28045a4..fd76bafe0 100644 --- a/llama_stack/providers/tests/datasetio/test_datasetio.py +++ b/llama_stack/providers/tests/datasetio/test_datasetio.py @@ -95,7 +95,7 @@ class TestDatasetIO: assert len(response) == 1 assert response[0].identifier == "test_dataset" - with pytest.raises(Exception) as exc_info: + with pytest.raises(ValueError): # unregister a dataset that does not exist await datasets_impl.unregister_dataset("test_dataset2") @@ -104,7 +104,7 @@ class TestDatasetIO: assert isinstance(response, list) assert len(response) == 0 - with pytest.raises(Exception) as exc_info: + with pytest.raises(ValueError): await datasets_impl.unregister_dataset("test_dataset") @pytest.mark.asyncio diff --git a/llama_stack/providers/tests/inference/test_model_registration.py b/llama_stack/providers/tests/inference/test_model_registration.py index 96a34ec0e..664564d22 100644 --- a/llama_stack/providers/tests/inference/test_model_registration.py +++ b/llama_stack/providers/tests/inference/test_model_registration.py @@ -32,7 +32,7 @@ class TestModelRegistration: ) # Try to register a model that's too large for local inference - with pytest.raises(ValueError) as exc_info: + with pytest.raises(ValueError): await models_impl.register_model( model_id="Llama3.1-70B-Instruct", ) @@ -42,7 +42,7 @@ class TestModelRegistration: _, models_impl = inference_stack # Try to register a non-existent model - with pytest.raises(Exception) as exc_info: + with pytest.raises(ValueError): await models_impl.register_model( model_id="Llama3-NonExistent-Model", ) @@ -59,7 +59,7 @@ class TestModelRegistration: }, ) - with pytest.raises(ValueError) as exc_info: + with pytest.raises(ValueError): await models_impl.register_model( model_id="custom-model-2", metadata={ @@ -88,7 +88,7 @@ class TestModelRegistration: async def test_register_with_invalid_llama_model(self, inference_stack): _, models_impl = inference_stack - with pytest.raises(ValueError) as exc_info: + with pytest.raises(ValueError): await models_impl.register_model( model_id="custom-model-2", metadata={"llama_model": "invalid-llama-model"},