@@ -110,12 +110,12 @@ async def test_get_ec2_instance_capabilities(
110110 simcore_ec2_api : SimcoreEC2API ,
111111 ec2_allowed_instances : list [InstanceTypeType ],
112112):
113- instance_types : list [EC2InstanceType ] = (
114- await simcore_ec2_api . get_ec2_instance_capabilities (
115- cast (
116- set [ InstanceTypeType ],
117- set ( ec2_allowed_instances ) ,
118- )
113+ instance_types : list [
114+ EC2InstanceType
115+ ] = await simcore_ec2_api . get_ec2_instance_capabilities (
116+ cast (
117+ set [ InstanceTypeType ] ,
118+ set ( ec2_allowed_instances ),
119119 )
120120 )
121121 assert instance_types
@@ -128,9 +128,9 @@ async def test_get_ec2_instance_capabilities_returns_all_options(
128128 instance_types = await simcore_ec2_api .get_ec2_instance_capabilities ("ALL" )
129129 assert instance_types
130130 # NOTE: this might need adaptation when moto is updated
131- assert (
132- 850 < len (instance_types ) < 877
133- ), f"received { len ( instance_types ) } , the test might need adaptation"
131+ assert 850 < len ( instance_types ) < 877 , (
132+ f"received { len (instance_types )} , the test might need adaptation"
133+ )
134134
135135
136136async def test_get_ec2_instance_capabilities_raise_with_empty_set (
@@ -156,9 +156,9 @@ async def fake_ec2_instance_type(
156156 request : pytest .FixtureRequest ,
157157) -> EC2InstanceType :
158158 instance_type_name : InstanceTypeType = request .param
159- instance_types : list [EC2InstanceType ] = (
160- await simcore_ec2_api . get_ec2_instance_capabilities ({ instance_type_name })
161- )
159+ instance_types : list [
160+ EC2InstanceType
161+ ] = await simcore_ec2_api . get_ec2_instance_capabilities ({ instance_type_name } )
162162
163163 assert len (instance_types ) == 1
164164 return instance_types [0 ]
@@ -785,7 +785,9 @@ async def mock_run_instances(*args, **kwargs) -> Any:
785785 mocker .patch .object (
786786 simcore_ec2_api .client , "run_instances" , side_effect = mock_run_instances
787787 )
788- with pytest .raises (EC2InsufficientCapacityError ) as exc_info :
788+ with pytest .raises (
789+ EC2InsufficientCapacityError , match = fake_ec2_instance_type .name
790+ ) as exc_info :
789791 await simcore_ec2_api .launch_instances (
790792 ec2_instance_config ,
791793 min_number_of_instances = 1 ,
0 commit comments