@@ -449,7 +449,7 @@ async def test_load_client_connect_config(client: Client, tmp_path: Path):
449449 config = ClientConfig .load_client_connect_config (config_file = str (config_file ))
450450 assert config .get ("target_host" ) == target_host
451451 assert config .get ("namespace" ) == namespace
452- new_client = await Client .connect (** config ) # type: ignore
452+ new_client = await Client .connect (** config )
453453 assert new_client .service_client .config .target_host == target_host
454454 assert new_client .namespace == namespace
455455
@@ -462,7 +462,7 @@ async def test_load_client_connect_config(client: Client, tmp_path: Path):
462462 rpc_metadata = config .get ("rpc_metadata" )
463463 assert rpc_metadata
464464 assert "custom-header" in rpc_metadata
465- new_client = await Client .connect (** config ) # type: ignore
465+ new_client = await Client .connect (** config )
466466 assert new_client .service_client .config .target_host == target_host
467467 assert new_client .namespace == "custom-namespace"
468468 assert (
@@ -476,7 +476,7 @@ async def test_load_client_connect_config(client: Client, tmp_path: Path):
476476 )
477477 assert config .get ("target_host" ) == target_host
478478 assert config .get ("namespace" ) == "env-namespace-override"
479- new_client = await Client .connect (** config ) # type: ignore
479+ new_client = await Client .connect (** config )
480480 assert new_client .namespace == "env-namespace-override"
481481
482482 # Test with env overrides disabled
@@ -487,7 +487,7 @@ async def test_load_client_connect_config(client: Client, tmp_path: Path):
487487 )
488488 assert config .get ("target_host" ) == target_host
489489 assert config .get ("namespace" ) == namespace
490- new_client = await Client .connect (** config ) # type: ignore
490+ new_client = await Client .connect (** config )
491491 assert new_client .namespace == namespace
492492
493493 # Test with file loading disabled (so only env is used)
@@ -500,11 +500,18 @@ async def test_load_client_connect_config(client: Client, tmp_path: Path):
500500 )
501501 assert config .get ("target_host" ) == target_host
502502 assert config .get ("namespace" ) == "env-only-namespace"
503- new_client = await Client .connect (** config ) # type: ignore
503+ new_client = await Client .connect (** config )
504504 assert new_client .service_client .config .target_host == target_host
505505 assert new_client .namespace == "env-only-namespace"
506506
507507
508+ def test_to_client_connect_config_missing_address_fails ():
509+ """Test that to_client_connect_config raises a ValueError if address is missing."""
510+ profile = ClientConfigProfile ()
511+ with pytest .raises (ValueError , match = "must contain an 'address'" ):
512+ profile .to_client_connect_config ()
513+
514+
508515def test_disables_raise_error ():
509516 """Test that providing both disable_file and disable_env raises an error."""
510517 with pytest .raises (RuntimeError , match = "Cannot disable both" ):
0 commit comments