1+ from typing import TypedDict
2+
13import boto3
24import pytest
35
6+ from .. import conftest
47from ..utils import helpers
58
69
710@pytest .fixture (scope = "module" )
8- def config ():
11+ def config () -> conftest . LambdaConfig :
912 return {
1013 "parameters" : {},
1114 "environment_variables" : {
@@ -17,15 +20,15 @@ def config():
1720
1821
1922@pytest .mark .e2e
20- def test_basic_lambda_logs_visible (execute_lambda , config ):
23+ def test_basic_lambda_logs_visible (execute_lambda : conftest . LambdaExecution , config : conftest . LambdaConfig ):
2124 # GIVEN
2225 lambda_arn = execute_lambda ["arns" ]["basichandlerarn" ]
2326 timestamp = int (execute_lambda ["execution_time" ].timestamp () * 1000 )
2427 cw_client = boto3 .client ("logs" )
2528
2629 # WHEN
2730 filtered_logs = helpers .get_logs (
28- lambda_function_name = lambda_arn .split (":" )[- 1 ], start_time = timestamp , log_client = cw_client
31+ lambda_function_name = lambda_arn .split (":" )[- 1 ], start_time = timestamp , log_client = cw_client , run = "first"
2932 )
3033
3134 # THEN
@@ -37,7 +40,7 @@ def test_basic_lambda_logs_visible(execute_lambda, config):
3740
3841
3942@pytest .mark .e2e
40- def test_basic_lambda_no_debug_logs_visible (execute_lambda , config ):
43+ def test_basic_lambda_no_debug_logs_visible (execute_lambda : conftest . LambdaExecution , config : conftest . LambdaConfig ):
4144 # GIVEN
4245 lambda_arn = execute_lambda ["arns" ]["basichandlerarn" ]
4346 timestamp = int (execute_lambda ["execution_time" ].timestamp () * 1000 )
@@ -55,7 +58,7 @@ def test_basic_lambda_no_debug_logs_visible(execute_lambda, config):
5558
5659
5760@pytest .mark .e2e
58- def test_basic_lambda_contextual_data_logged (execute_lambda ):
61+ def test_basic_lambda_contextual_data_logged (execute_lambda : conftest . LambdaExecution ):
5962 # GIVEN
6063 lambda_arn = execute_lambda ["arns" ]["basichandlerarn" ]
6164 timestamp = int (execute_lambda ["execution_time" ].timestamp () * 1000 )
@@ -79,9 +82,10 @@ def test_basic_lambda_contextual_data_logged(execute_lambda):
7982
8083
8184@pytest .mark .e2e
82- def test_basic_lambda_additional_key_persistence_basic_lambda (execute_lambda , config ):
85+ def test_basic_lambda_additional_key_persistence_basic_lambda (
86+ execute_lambda : conftest .LambdaExecution , config : conftest .LambdaConfig
87+ ):
8388 # GIVEN
84-
8589 lambda_arn = execute_lambda ["arns" ]["basichandlerarn" ]
8690 timestamp = int (execute_lambda ["execution_time" ].timestamp () * 1000 )
8791 cw_client = boto3 .client ("logs" )
@@ -101,7 +105,7 @@ def test_basic_lambda_additional_key_persistence_basic_lambda(execute_lambda, co
101105
102106
103107@pytest .mark .e2e
104- def test_basic_lambda_empty_event_logged (execute_lambda ):
108+ def test_basic_lambda_empty_event_logged (execute_lambda : conftest . LambdaExecution ):
105109
106110 # GIVEN
107111 lambda_arn = execute_lambda ["arns" ]["basichandlerarn" ]
@@ -118,7 +122,7 @@ def test_basic_lambda_empty_event_logged(execute_lambda):
118122
119123
120124@pytest .mark .e2e
121- def test_no_context_lambda_contextual_data_not_logged (execute_lambda ):
125+ def test_no_context_lambda_contextual_data_not_logged (execute_lambda : conftest . LambdaExecution ):
122126
123127 # GIVEN
124128 lambda_arn = execute_lambda ["arns" ]["nocontexthandlerarn" ]
@@ -145,7 +149,7 @@ def test_no_context_lambda_contextual_data_not_logged(execute_lambda):
145149
146150
147151@pytest .mark .e2e
148- def test_no_context_lambda_event_not_logged (execute_lambda ):
152+ def test_no_context_lambda_event_not_logged (execute_lambda : conftest . LambdaExecution ):
149153
150154 # GIVEN
151155 lambda_arn = execute_lambda ["arns" ]["nocontexthandlerarn" ]
0 commit comments