[tests] Fix connection test expected error type.
@@ -49,7 +49,9 @@ def test_create_invalid_options():
def test_create_channel_failed_subprocess(
dead_connection: CompilerGymServiceConnection,
):
- with pytest.raises(ServiceError) as ctx:
+ with pytest.raises(
+ (ServiceError, TimeoutError), match="Failed to create connection to localhost:"
+ ):
CompilerGymServiceConnection(
f"{dead_connection.connection.url}",
ConnectionOpts(
@@ -59,9 +61,6 @@ def test_create_channel_failed_subprocess(
),
)
- assert str(ctx.value).startswith("Failed to create connection to localhost:")
- assert " (2 attempts made)" in str(ctx.value)
-
def test_create_channel_failed_subprocess_rpc_timeout(
dead_connection: CompilerGymServiceConnection,
