@@ -228,9 +228,9 @@ def assert_log_record(caplog, errno=0, level=logging.INFO, rid=None, t=int, path
228228
229229def test_request_summary (caplog , dockerflow , test_client ):
230230 request , _ = test_client .get (headers = headers )
231- assert isinstance (request .get ( "_start_timestamp" ) , float )
232- assert request .get ( "_id" ) is not None
233- assert_log_record (caplog , rid = request .get ( "_id" ) )
231+ assert isinstance (request .ctx . start_timestamp , float )
232+ assert request .ctx . id is not None
233+ assert_log_record (caplog , rid = request .ctx . id )
234234
235235
236236def test_request_summary_exception (app , caplog , dockerflow , test_client ):
@@ -240,7 +240,7 @@ def exception_raiser(request):
240240
241241 request , _ = test_client .get ("/exception" , headers = headers )
242242 record = assert_log_record (
243- caplog , 500 , logging .ERROR , request .get ( "_id" ) , path = "/exception"
243+ caplog , 500 , logging .ERROR , request .ctx . id , path = "/exception"
244244 )
245245 assert record .getMessage () == "exception message"
246246
@@ -249,8 +249,8 @@ def test_request_summary_failed_request(app, caplog, dockerflow, test_client):
249249 @app .middleware
250250 def hostile_callback (request ):
251251 # simulating resetting request changes
252- del request [ "_id" ]
253- del request [ "_start_timestamp" ]
252+ del request . ctx . id
253+ del request . ctx . start_timestamp
254254
255255 test_client .get (headers = headers )
256256 assert_log_record (caplog , rid = None , t = None )
0 commit comments