@@ -220,36 +220,32 @@ def test_loaded_key_infos():
220220 assert cmp ._regional_clients == {}
221221
222222
223- @pytest .mark .parametrize (
224- "kwargs" ,
225- [
226- pytest .param (val , id = str (val ))
227- for val in all_possible_combinations_kwargs (
228- {},
229- dict (botocore_session = botocore .session .Session ()),
230- dict (grant_tokens = ("sdvoaweih" , "auwshefiouawh" )),
231- dict (material_description = {"asoiufeoia" : "soajfijewi" }),
232- dict (
233- regional_clients = {
234- "my-region-1" : boto3 .session .Session ().client (
235- "kms" , region_name = "not-a-real-region" , endpoint_url = "https://not-a-real-url"
236- )
237- }
238- ),
239- )
240- ],
241- )
242- def test_kms_cmp_values_set (kwargs ):
243- cmp = AwsKmsCryptographicMaterialsProvider (key_id = "example_key_id" , ** kwargs )
223+ def test_kms_cmp_values_set ():
224+ # These aren't parametrized to avoid issues with pytest-xdist test mismatches
225+ # due to different session objects per process
226+ for kwargs in all_possible_combinations_kwargs (
227+ {},
228+ dict (botocore_session = botocore .session .Session ()),
229+ dict (grant_tokens = ("sdvoaweih" , "auwshefiouawh" )),
230+ dict (material_description = {"asoiufeoia" : "soajfijewi" }),
231+ dict (
232+ regional_clients = {
233+ "my-region-1" : boto3 .session .Session ().client (
234+ "kms" , region_name = "not-a-real-region" , endpoint_url = "https://not-a-real-url"
235+ )
236+ }
237+ ),
238+ ):
239+ cmp = AwsKmsCryptographicMaterialsProvider (key_id = "example_key_id" , ** kwargs )
244240
245- assert cmp ._key_id == "example_key_id"
241+ assert cmp ._key_id == "example_key_id"
246242
247- if "botocore_session" in kwargs :
248- assert cmp ._botocore_session == kwargs ["botocore_session" ]
243+ if "botocore_session" in kwargs :
244+ assert cmp ._botocore_session == kwargs ["botocore_session" ]
249245
250- assert cmp ._grant_tokens == kwargs .get ("grant_tokens" , ())
251- assert cmp ._material_description == kwargs .get ("material_description" , {})
252- assert cmp ._regional_clients == kwargs .get ("regional_clients" , {})
246+ assert cmp ._grant_tokens == kwargs .get ("grant_tokens" , ())
247+ assert cmp ._material_description == kwargs .get ("material_description" , {})
248+ assert cmp ._regional_clients == kwargs .get ("regional_clients" , {})
253249
254250
255251def test_add_regional_client_known_region (default_kms_cmp , patch_boto3_session ):
0 commit comments