Skip to content

Commit 1d65de7

Browse files
committed
Fixed tests that was broken by too much data in event
1 parent 6d89186 commit 1d65de7

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

sentry_sdk/integrations/logging.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@
4040
# Note: Ignoring by logger name here is better than mucking with thread-locals.
4141
# We do not necessarily know whether thread-locals work 100% correctly in the user's environment.
4242
_IGNORED_LOGGERS = set(
43-
["sentry_sdk.errors", "urllib3.connectionpool", "urllib3.connection", "opentelemetry.*"]
43+
[
44+
"sentry_sdk.errors",
45+
"urllib3.connectionpool",
46+
"urllib3.connection",
47+
"opentelemetry.*",
48+
]
4449
)
4550

4651

tests/integrations/aws_lambda/test_aws.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ def truncate_data(data):
6767
6868
if data["contexts"].get("trace") is not None:
6969
cleaned_data["contexts"]["trace"] = data["contexts"].get("trace")
70+
if cleaned_data["contexts"]["trace"].get("data", {}) != {}:
71+
cleaned_data["contexts"]["trace"]["data"] = {"removed": "by truncate_data()"}
7072
7173
if data.get("transaction") is not None:
7274
cleaned_data["transaction"] = data.get("transaction")
@@ -488,6 +490,15 @@ def test_handler(event, context):
488490
),
489491
(b"[]", False, 1),
490492
],
493+
ids=[
494+
"int",
495+
"float",
496+
"string",
497+
"bool",
498+
"list",
499+
"list_with_request_data",
500+
"empty_list",
501+
],
491502
)
492503
def test_non_dict_event(
493504
run_lambda_function,
@@ -540,9 +551,7 @@ def test_handler(event, context):
540551
"headers": {"Host": "x1.io", "X-Forwarded-Proto": "https"},
541552
"method": "GET",
542553
"url": "https://x1.io/1",
543-
"query_string": {
544-
"done": "f",
545-
},
554+
"query_string": "done=f",
546555
}
547556
else:
548557
request_data = {"url": "awslambda:///{}".format(function_name)}

0 commit comments

Comments
 (0)