Skip to content

Commit a57575a

Browse files
committed
Added init error test
1 parent 3c540a5 commit a57575a

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
# We have no handler() here and try to call a non-existing function.
3+
4+
func()

tests/integrations/aws_lambda/test_aws_lambda.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,16 @@ def test_basic_exception(lambda_client, test_environment):
174174
"origin": "auto.function.aws_lambda",
175175
"data": mock.ANY,
176176
}
177+
178+
179+
def test_init_error(lambda_client, test_environment):
180+
lambda_client.invoke(
181+
FunctionName="InitError",
182+
Payload=json.dumps({}),
183+
)
184+
envelopes = test_environment["server"].envelopes
185+
186+
(error_event, transaction_event) = envelopes
187+
188+
assert error_event["exception"]["values"][0]["value"] == "name 'func' is not defined"
189+
assert transaction_event["transaction"] == "InitError"

0 commit comments

Comments
 (0)