@@ -43,14 +43,7 @@ def get_dataclasses_lib():
43
43
44
44
# Using parametrize to run test twice, with two separate instances of persistence store. One instance with caching
45
45
# enabled, and one without.
46
- @pytest .mark .parametrize (
47
- "idempotency_config" ,
48
- [
49
- {"use_local_cache" : False },
50
- {"use_local_cache" : True },
51
- ],
52
- indirect = True ,
53
- )
46
+ @pytest .mark .parametrize ("idempotency_config" , [{"use_local_cache" : False }, {"use_local_cache" : True }], indirect = True )
54
47
def test_idempotent_lambda_already_completed (
55
48
idempotency_config : IdempotencyConfig ,
56
49
persistence_store : DynamoDBPersistenceLayer ,
@@ -95,14 +88,7 @@ def lambda_handler(event, context):
95
88
stubber .deactivate ()
96
89
97
90
98
- @pytest .mark .parametrize (
99
- "idempotency_config" ,
100
- [
101
- {"use_local_cache" : False },
102
- {"use_local_cache" : True },
103
- ],
104
- indirect = True ,
105
- )
91
+ @pytest .mark .parametrize ("idempotency_config" , [{"use_local_cache" : False }, {"use_local_cache" : True }], indirect = True )
106
92
def test_idempotent_lambda_in_progress (
107
93
idempotency_config : IdempotencyConfig ,
108
94
persistence_store : DynamoDBPersistenceLayer ,
@@ -151,13 +137,7 @@ def lambda_handler(event, context):
151
137
152
138
153
139
@pytest .mark .skipif (sys .version_info < (3 , 8 ), reason = "issue with pytest mock lib for < 3.8" )
154
- @pytest .mark .parametrize (
155
- "idempotency_config" ,
156
- [
157
- {"use_local_cache" : True },
158
- ],
159
- indirect = True ,
160
- )
140
+ @pytest .mark .parametrize ("idempotency_config" , [{"use_local_cache" : True }], indirect = True )
161
141
def test_idempotent_lambda_in_progress_with_cache (
162
142
idempotency_config : IdempotencyConfig ,
163
143
persistence_store : DynamoDBPersistenceLayer ,
@@ -222,14 +202,7 @@ def lambda_handler(event, context):
222
202
stubber .deactivate ()
223
203
224
204
225
- @pytest .mark .parametrize (
226
- "idempotency_config" ,
227
- [
228
- {"use_local_cache" : False },
229
- {"use_local_cache" : True },
230
- ],
231
- indirect = True ,
232
- )
205
+ @pytest .mark .parametrize ("idempotency_config" , [{"use_local_cache" : False }, {"use_local_cache" : True }], indirect = True )
233
206
def test_idempotent_lambda_first_execution (
234
207
idempotency_config : IdempotencyConfig ,
235
208
persistence_store : DynamoDBPersistenceLayer ,
@@ -260,13 +233,7 @@ def lambda_handler(event, context):
260
233
stubber .deactivate ()
261
234
262
235
263
- @pytest .mark .parametrize (
264
- "idempotency_config" ,
265
- [
266
- {"use_local_cache" : True },
267
- ],
268
- indirect = True ,
269
- )
236
+ @pytest .mark .parametrize ("idempotency_config" , [{"use_local_cache" : True }], indirect = True )
270
237
def test_idempotent_lambda_first_execution_cached (
271
238
idempotency_config : IdempotencyConfig ,
272
239
persistence_store : DynamoDBPersistenceLayer ,
@@ -312,13 +279,7 @@ def lambda_handler(event, context):
312
279
stubber .deactivate ()
313
280
314
281
315
- @pytest .mark .parametrize (
316
- "idempotency_config" ,
317
- [
318
- {"use_local_cache" : True , "event_key_jmespath" : "body" },
319
- ],
320
- indirect = True ,
321
- )
282
+ @pytest .mark .parametrize ("idempotency_config" , [{"use_local_cache" : True , "event_key_jmespath" : "body" }], indirect = True )
322
283
def test_idempotent_lambda_first_execution_event_mutation (
323
284
idempotency_config : IdempotencyConfig ,
324
285
persistence_store : DynamoDBPersistenceLayer ,
@@ -356,14 +317,7 @@ def lambda_handler(event, context):
356
317
stubber .deactivate ()
357
318
358
319
359
- @pytest .mark .parametrize (
360
- "idempotency_config" ,
361
- [
362
- {"use_local_cache" : False },
363
- {"use_local_cache" : True },
364
- ],
365
- indirect = True ,
366
- )
320
+ @pytest .mark .parametrize ("idempotency_config" , [{"use_local_cache" : False }, {"use_local_cache" : True }], indirect = True )
367
321
def test_idempotent_lambda_expired (
368
322
idempotency_config : IdempotencyConfig ,
369
323
persistence_store : DynamoDBPersistenceLayer ,
@@ -396,14 +350,7 @@ def lambda_handler(event, context):
396
350
stubber .deactivate ()
397
351
398
352
399
- @pytest .mark .parametrize (
400
- "idempotency_config" ,
401
- [
402
- {"use_local_cache" : False },
403
- {"use_local_cache" : True },
404
- ],
405
- indirect = True ,
406
- )
353
+ @pytest .mark .parametrize ("idempotency_config" , [{"use_local_cache" : False }, {"use_local_cache" : True }], indirect = True )
407
354
def test_idempotent_lambda_exception (
408
355
idempotency_config : IdempotencyConfig ,
409
356
persistence_store : DynamoDBPersistenceLayer ,
@@ -491,14 +438,7 @@ def lambda_handler(event, context):
491
438
stubber .deactivate ()
492
439
493
440
494
- @pytest .mark .parametrize (
495
- "idempotency_config" ,
496
- [
497
- {"use_local_cache" : False },
498
- {"use_local_cache" : True },
499
- ],
500
- indirect = True ,
501
- )
441
+ @pytest .mark .parametrize ("idempotency_config" , [{"use_local_cache" : False }, {"use_local_cache" : True }], indirect = True )
502
442
def test_idempotent_lambda_expired_during_request (
503
443
idempotency_config : IdempotencyConfig ,
504
444
persistence_store : DynamoDBPersistenceLayer ,
@@ -554,14 +494,7 @@ def lambda_handler(event, context):
554
494
stubber .deactivate ()
555
495
556
496
557
- @pytest .mark .parametrize (
558
- "idempotency_config" ,
559
- [
560
- {"use_local_cache" : False },
561
- {"use_local_cache" : True },
562
- ],
563
- indirect = True ,
564
- )
497
+ @pytest .mark .parametrize ("idempotency_config" , [{"use_local_cache" : False }, {"use_local_cache" : True }], indirect = True )
565
498
def test_idempotent_persistence_exception_deleting (
566
499
idempotency_config : IdempotencyConfig ,
567
500
persistence_store : DynamoDBPersistenceLayer ,
@@ -593,14 +526,7 @@ def lambda_handler(event, context):
593
526
stubber .deactivate ()
594
527
595
528
596
- @pytest .mark .parametrize (
597
- "idempotency_config" ,
598
- [
599
- {"use_local_cache" : False },
600
- {"use_local_cache" : True },
601
- ],
602
- indirect = True ,
603
- )
529
+ @pytest .mark .parametrize ("idempotency_config" , [{"use_local_cache" : False }, {"use_local_cache" : True }], indirect = True )
604
530
def test_idempotent_persistence_exception_updating (
605
531
idempotency_config : IdempotencyConfig ,
606
532
persistence_store : DynamoDBPersistenceLayer ,
@@ -632,14 +558,7 @@ def lambda_handler(event, context):
632
558
stubber .deactivate ()
633
559
634
560
635
- @pytest .mark .parametrize (
636
- "idempotency_config" ,
637
- [
638
- {"use_local_cache" : False },
639
- {"use_local_cache" : True },
640
- ],
641
- indirect = True ,
642
- )
561
+ @pytest .mark .parametrize ("idempotency_config" , [{"use_local_cache" : False }, {"use_local_cache" : True }], indirect = True )
643
562
def test_idempotent_persistence_exception_getting (
644
563
idempotency_config : IdempotencyConfig ,
645
564
persistence_store : DynamoDBPersistenceLayer ,
@@ -706,12 +625,7 @@ def lambda_handler(event, context):
706
625
707
626
708
627
@pytest .mark .parametrize (
709
- "config_without_jmespath" ,
710
- [
711
- {"use_local_cache" : False },
712
- {"use_local_cache" : True },
713
- ],
714
- indirect = True ,
628
+ "config_without_jmespath" , [{"use_local_cache" : False }, {"use_local_cache" : True }], indirect = True
715
629
)
716
630
def test_idempotent_lambda_with_validator_util (
717
631
config_without_jmespath : IdempotencyConfig ,
@@ -762,14 +676,7 @@ def lambda_handler(event, context):
762
676
stubber .deactivate ()
763
677
764
678
765
- @pytest .mark .parametrize (
766
- "idempotency_config" ,
767
- [
768
- {"use_local_cache" : False },
769
- {"use_local_cache" : True },
770
- ],
771
- indirect = True ,
772
- )
679
+ @pytest .mark .parametrize ("idempotency_config" , [{"use_local_cache" : False }, {"use_local_cache" : True }], indirect = True )
773
680
def test_idempotent_lambda_expires_in_progress_before_expire (
774
681
idempotency_config : IdempotencyConfig ,
775
682
persistence_store : DynamoDBPersistenceLayer ,
@@ -821,14 +728,7 @@ def lambda_handler(event, context):
821
728
stubber .deactivate ()
822
729
823
730
824
- @pytest .mark .parametrize (
825
- "idempotency_config" ,
826
- [
827
- {"use_local_cache" : False },
828
- {"use_local_cache" : True },
829
- ],
830
- indirect = True ,
831
- )
731
+ @pytest .mark .parametrize ("idempotency_config" , [{"use_local_cache" : False }, {"use_local_cache" : True }], indirect = True )
832
732
def test_idempotent_lambda_expires_in_progress_after_expire (
833
733
idempotency_config : IdempotencyConfig ,
834
734
persistence_store : DynamoDBPersistenceLayer ,
@@ -873,14 +773,7 @@ def lambda_handler(event, context):
873
773
stubber .deactivate ()
874
774
875
775
876
- @pytest .mark .parametrize (
877
- "idempotency_config" ,
878
- [
879
- {"use_local_cache" : False },
880
- {"use_local_cache" : True },
881
- ],
882
- indirect = True ,
883
- )
776
+ @pytest .mark .parametrize ("idempotency_config" , [{"use_local_cache" : False }, {"use_local_cache" : True }], indirect = True )
884
777
def test_idempotent_lambda_expires_in_progress_unavailable_remaining_time (
885
778
idempotency_config : IdempotencyConfig ,
886
779
persistence_store : DynamoDBPersistenceLayer ,
@@ -943,13 +836,7 @@ def test_data_record_json_to_dict_mapping_when_response_data_none():
943
836
assert response_data is None
944
837
945
838
946
- @pytest .mark .parametrize (
947
- "idempotency_config" ,
948
- [
949
- {"use_local_cache" : True },
950
- ],
951
- indirect = True ,
952
- )
839
+ @pytest .mark .parametrize ("idempotency_config" , [{"use_local_cache" : True }], indirect = True )
953
840
def test_in_progress_never_saved_to_cache (
954
841
idempotency_config : IdempotencyConfig , persistence_store : DynamoDBPersistenceLayer
955
842
):
@@ -965,13 +852,7 @@ def test_in_progress_never_saved_to_cache(
965
852
assert persistence_store ._cache .get ("key" ) is None
966
853
967
854
968
- @pytest .mark .parametrize (
969
- "idempotency_config" ,
970
- [
971
- {"use_local_cache" : False },
972
- ],
973
- indirect = True ,
974
- )
855
+ @pytest .mark .parametrize ("idempotency_config" , [{"use_local_cache" : False }], indirect = True )
975
856
def test_user_local_disabled (idempotency_config : IdempotencyConfig , persistence_store : DynamoDBPersistenceLayer ):
976
857
# GIVEN a persistence_store with use_local_cache = False
977
858
persistence_store .configure (idempotency_config )
@@ -991,13 +872,7 @@ def test_user_local_disabled(idempotency_config: IdempotencyConfig, persistence_
991
872
assert not hasattr ("persistence_store" , "_cache" )
992
873
993
874
994
- @pytest .mark .parametrize (
995
- "idempotency_config" ,
996
- [
997
- {"use_local_cache" : True },
998
- ],
999
- indirect = True ,
1000
- )
875
+ @pytest .mark .parametrize ("idempotency_config" , [{"use_local_cache" : True }], indirect = True )
1001
876
def test_delete_from_cache_when_empty (
1002
877
idempotency_config : IdempotencyConfig , persistence_store : DynamoDBPersistenceLayer
1003
878
):
@@ -1048,11 +923,7 @@ def test_is_missing_idempotency_key():
1048
923
1049
924
1050
925
@pytest .mark .parametrize (
1051
- "idempotency_config" ,
1052
- [
1053
- {"use_local_cache" : False , "event_key_jmespath" : "body" },
1054
- ],
1055
- indirect = True ,
926
+ "idempotency_config" , [{"use_local_cache" : False , "event_key_jmespath" : "body" }], indirect = True
1056
927
)
1057
928
def test_default_no_raise_on_missing_idempotency_key (
1058
929
idempotency_config : IdempotencyConfig , persistence_store : DynamoDBPersistenceLayer
@@ -1354,13 +1225,7 @@ def dummy_handler(event, context):
1354
1225
assert len (persistence_store .table .method_calls ) == 0
1355
1226
1356
1227
1357
- @pytest .mark .parametrize (
1358
- "idempotency_config" ,
1359
- [
1360
- {"use_local_cache" : True },
1361
- ],
1362
- indirect = True ,
1363
- )
1228
+ @pytest .mark .parametrize ("idempotency_config" , [{"use_local_cache" : True }], indirect = True )
1364
1229
def test_idempotent_function_duplicates (
1365
1230
idempotency_config : IdempotencyConfig , persistence_store : DynamoDBPersistenceLayer
1366
1231
):
@@ -1477,13 +1342,7 @@ def collect_payment(payment: Payment):
1477
1342
assert result == payment .transaction_id
1478
1343
1479
1344
1480
- @pytest .mark .parametrize (
1481
- "idempotency_config" ,
1482
- [
1483
- {"use_local_cache" : False },
1484
- ],
1485
- indirect = True ,
1486
- )
1345
+ @pytest .mark .parametrize ("idempotency_config" , [{"use_local_cache" : False }], indirect = True )
1487
1346
def test_idempotent_lambda_compound_already_completed (
1488
1347
idempotency_config : IdempotencyConfig ,
1489
1348
persistence_store_compound : DynamoDBPersistenceLayer ,
0 commit comments