File tree Expand file tree Collapse file tree 6 files changed +17
-13
lines changed Expand file tree Collapse file tree 6 files changed +17
-13
lines changed Original file line number Diff line number Diff line change 33from pathlib import Path
44
55import pytest
6+ from pytest_subtests import SubTests
67
78from pydantic import ValidationError
89
@@ -30,7 +31,7 @@ def test_conversation_cache_unknown_type() -> None:
3031 _ = ConversationCacheConfiguration (type = "foo" )
3132
3233
33- def test_conversation_cache_correct_type_but_not_configured (subtests ) -> None :
34+ def test_conversation_cache_correct_type_but_not_configured (subtests : SubTests ) -> None :
3435 """Check the test for cache type."""
3536 with subtests .test (msg = "Memory cache" ):
3637 with pytest .raises (
@@ -51,7 +52,7 @@ def test_conversation_cache_correct_type_but_not_configured(subtests) -> None:
5152 _ = ConversationCacheConfiguration (type = constants .CACHE_TYPE_POSTGRES )
5253
5354
54- def test_conversation_cache_no_type_but_configured (subtests ) -> None :
55+ def test_conversation_cache_no_type_but_configured (subtests : SubTests ) -> None :
5556 """Check the test for cache type."""
5657 m = "Conversation cache type must be set when backend configuration is provided"
5758
@@ -79,7 +80,7 @@ def test_conversation_cache_no_type_but_configured(subtests) -> None:
7980 _ = ConversationCacheConfiguration (postgres = d )
8081
8182
82- def test_conversation_cache_multiple_configurations (subtests ) -> None :
83+ def test_conversation_cache_multiple_configurations (subtests : SubTests ) -> None :
8384 """Test how multiple configurations are handled."""
8485 d = PostgreSQLDatabaseConfiguration (
8586 db = "db" ,
Original file line number Diff line number Diff line change 11"""Unit tests for Customization model."""
22
33import pytest
4+ from pytest_subtests import SubTests
45
56from pydantic import ValidationError
67
78from models .config import Customization
89
910
10- def test_service_customization (subtests ) -> None :
11+ def test_service_customization (subtests : SubTests ) -> None :
1112 """Check the service customization class."""
1213 with subtests .test (msg = "System prompt is enabled" ):
1314 c = Customization ()
@@ -43,7 +44,7 @@ def test_service_customization_wrong_system_prompt_path() -> None:
4344 _ = Customization (system_prompt_path = "/path/does/not/exists" )
4445
4546
46- def test_service_customization_correct_system_prompt_path (subtests ) -> None :
47+ def test_service_customization_correct_system_prompt_path (subtests : SubTests ) -> None :
4748 """Check the service customization class."""
4849 with subtests .test (msg = "One line system prompt" ):
4950 # pass a file containing system prompt
Original file line number Diff line number Diff line change 33from pathlib import Path
44
55import pytest
6+ from pytest_subtests import SubTests
67
78from pydantic import ValidationError
89
1314)
1415
1516
16- def test_database_configuration (subtests ) -> None :
17+ def test_database_configuration (subtests : SubTests ) -> None :
1718 """Test the database configuration handling."""
1819 with subtests .test (msg = "PostgreSQL" ):
1920 d1 = PostgreSQLDatabaseConfiguration (
Original file line number Diff line number Diff line change 2323)
2424
2525
26- def test_dump_configuration (tmp_path ) -> None :
26+ def test_dump_configuration (tmp_path : Path ) -> None :
2727 """
2828 Test that the Configuration object can be serialized to a JSON file and
2929 that the resulting file contains all expected sections and values.
@@ -186,7 +186,7 @@ def test_dump_configuration(tmp_path) -> None:
186186 }
187187
188188
189- def test_dump_configuration_with_one_mcp_server (tmp_path ) -> None :
189+ def test_dump_configuration_with_one_mcp_server (tmp_path : Path ) -> None :
190190 """
191191 Verify that a configuration with a single MCP server can be
192192 serialized to JSON and that all expected fields and values are
@@ -234,7 +234,7 @@ def test_dump_configuration_with_one_mcp_server(tmp_path) -> None:
234234 ]
235235
236236
237- def test_dump_configuration_with_more_mcp_servers (tmp_path ) -> None :
237+ def test_dump_configuration_with_more_mcp_servers (tmp_path : Path ) -> None :
238238 """
239239 Test that a configuration with multiple MCP servers can be
240240 serialized to JSON and that all server entries are correctly
@@ -301,7 +301,7 @@ def test_dump_configuration_with_more_mcp_servers(tmp_path) -> None:
301301 ]
302302
303303
304- def test_dump_configuration_with_quota_limiters (tmp_path ) -> None :
304+ def test_dump_configuration_with_quota_limiters (tmp_path : Path ) -> None :
305305 """
306306 Test that the Configuration object can be serialized to a JSON file and
307307 that the resulting file contains all expected sections and values.
Original file line number Diff line number Diff line change 33from pathlib import Path
44
55import pytest
6+ from pytest_subtests import SubTests
67
78from pydantic import ValidationError
89
@@ -29,7 +30,7 @@ def test_postgresql_database_configuration() -> None:
2930 assert c .ca_cert_path is None
3031
3132
32- def test_postgresql_database_configuration_port_setting (subtests ) -> None :
33+ def test_postgresql_database_configuration_port_setting (subtests : SubTests ) -> None :
3334 """Test the PostgreSQLDatabaseConfiguration model."""
3435 with subtests .test (msg = "Correct port value" ):
3536 c = PostgreSQLDatabaseConfiguration (
@@ -51,7 +52,7 @@ def test_postgresql_database_configuration_port_setting(subtests) -> None:
5152 )
5253
5354
54- def test_postgresql_database_configuration_ca_cert_path (subtests ) -> None :
55+ def test_postgresql_database_configuration_ca_cert_path (subtests : SubTests ) -> None :
5556 """Test the PostgreSQLDatabaseConfiguration model."""
5657 with subtests .test (msg = "Path exists" ):
5758 c = PostgreSQLDatabaseConfiguration (
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ def test_get_documents(self) -> None:
102102
103103 def test_get_documents_no_attachments (self ) -> None :
104104 """Test the get_documents method."""
105- attachments = []
105+ attachments : list [ Attachment ] = []
106106 qr = QueryRequest (
107107 query = "Tell me about Kubernetes" ,
108108 attachments = attachments ,
You can’t perform that action at this time.
0 commit comments