File tree Expand file tree Collapse file tree 3 files changed +1
-9
lines changed
src/functions_framework/aio
test_functions/execution_id Expand file tree Collapse file tree 3 files changed +1
-9
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,6 @@ async def _handle_not_found(request: Request):
164164
165165
166166def _configure_app_execution_id_logging ():
167- # Logging needs to be configured before app logger is accessed
168167 logging .config .dictConfig (
169168 {
170169 "version" : 1 ,
Original file line number Diff line number Diff line change @@ -224,11 +224,7 @@ def view_func():
224224 execution_id , "_generate_execution_id" , lambda : TEST_EXECUTION_ID
225225 )
226226
227- # Use a simple object instead of Mock to properly test attribute assignment
228- class MockG :
229- pass
230-
231- mock_g = MockG ()
227+ mock_g = Mock ()
232228 monkeypatch .setattr (execution_id .flask , "g" , mock_g )
233229 monkeypatch .setattr (execution_id .flask , "has_request_context" , lambda : True )
234230 execution_id .set_execution_context (request )(view_func )()
Original file line number Diff line number Diff line change @@ -43,17 +43,14 @@ async def async_trace_test(request):
4343 }
4444
4545
46- # Sync function to test the sync branch in async decorator
4746def sync_function_in_async_context (request ):
48- """A sync function that can be called from async context."""
4947 return {
5048 "execution_id" : request .headers .get ("Function-Execution-Id" ),
5149 "type" : "sync" ,
5250 }
5351
5452
5553def sync_cloudevent_with_context (cloud_event ):
56- """A sync CloudEvent function that accesses execution context."""
5754 context = execution_id ._get_current_context ()
5855 if context :
5956 logger .info (f"Execution ID in sync CloudEvent: { context .execution_id } " )
You can’t perform that action at this time.
0 commit comments