File tree 3 files changed +6
-6
lines changed
tests/functional/idempotency
3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 23
23
BaseIdempotencySerializer ,
24
24
)
25
25
from aws_lambda_powertools .utilities .typing import LambdaContext
26
- from aws_lambda_powertools .warnings import PowertoolsWarning
26
+ from aws_lambda_powertools .warnings import PowertoolsUserWarning
27
27
28
28
logger = logging .getLogger (__name__ )
29
29
@@ -76,7 +76,7 @@ def idempotent(
76
76
warnings .warn (
77
77
message = "Disabling idempotency is intended for development environments only "
78
78
"and should not be used in production." ,
79
- category = PowertoolsWarning ,
79
+ category = PowertoolsUserWarning ,
80
80
stacklevel = 2 ,
81
81
)
82
82
return handler (event , context , ** kwargs )
@@ -169,7 +169,7 @@ def decorate(*args, **kwargs):
169
169
warnings .warn (
170
170
message = "Disabling idempotency is intended for development environments only "
171
171
"and should not be used in production." ,
172
- category = PowertoolsWarning ,
172
+ category = PowertoolsUserWarning ,
173
173
stacklevel = 2 ,
174
174
)
175
175
return function (* args , ** kwargs )
Original file line number Diff line number Diff line change 1
1
"""Shared warnings that don't belong to a single utility"""
2
2
3
3
4
- class PowertoolsWarning (UserWarning ):
4
+ class PowertoolsUserWarning (UserWarning ):
5
5
"""
6
6
This class provides a custom Warning tailored for better clarity when certain situations occur.
7
7
It offers more informative and relevant warning messages, allowing customers to easily suppress
Original file line number Diff line number Diff line change 51
51
PydanticSerializer ,
52
52
)
53
53
from aws_lambda_powertools .utilities .validation import envelopes , validator
54
- from aws_lambda_powertools .warnings import PowertoolsWarning
54
+ from aws_lambda_powertools .warnings import PowertoolsUserWarning
55
55
from tests .functional .idempotency .utils import (
56
56
build_idempotency_put_item_response_stub ,
57
57
build_idempotency_put_item_stub ,
@@ -1719,7 +1719,7 @@ def dummy(data):
1719
1719
def dummy_handler (event , context ):
1720
1720
return {"message" : "hi" }
1721
1721
1722
- with pytest .warns (PowertoolsWarning , match = "Disabling idempotency is intended for development environments*" ):
1722
+ with pytest .warns (PowertoolsUserWarning , match = "Disabling idempotency is intended for development environments*" ):
1723
1723
dummy (data = mock_event )
1724
1724
dummy_handler (mock_event , lambda_context )
1725
1725
You can’t perform that action at this time.
0 commit comments