1818import pytest
1919import pytest_asyncio
2020
21- from pretend import call_recorder , stub
22-
2321from structlog import (
2422 PrintLogger ,
2523 ReturnLogger ,
5351from structlog .typing import BindableLogger , EventDict
5452
5553from .additional_frame import additional_frame
54+ from .helpers import call_recorder , stub
5655
5756
5857def build_bl (logger = None , processors = None , context = None ):
@@ -1100,7 +1099,7 @@ def test_pass_foreign_args_true_sets_positional_args_key(self):
11001099 positional_args = {"foo" : "bar" }
11011100 logging .getLogger ().info ("okay %(foo)s" , positional_args )
11021101
1103- event_dict = test_processor .calls [0 ].args [2 ]
1102+ event_dict = test_processor .call_args_list [0 ].args [2 ]
11041103
11051104 assert "positional_args" in event_dict
11061105 assert positional_args == event_dict ["positional_args" ]
@@ -1181,7 +1180,7 @@ def test_foreign_pre_chain_gets_exc_info(self):
11811180 except Exception :
11821181 logging .getLogger ().exception ("okay" )
11831182
1184- event_dict = test_processor .calls [0 ].args [2 ]
1183+ event_dict = test_processor .call_args_list [0 ].args [2 ]
11851184
11861185 assert "exc_info" in event_dict
11871186 assert isinstance (event_dict ["exc_info" ], tuple )
@@ -1209,7 +1208,7 @@ def add_excinfo(logger, log_method, event_dict):
12091208 except Exception :
12101209 logging .getLogger ().error ("okay" )
12111210
1212- event_dict = test_processor .calls [0 ].args [2 ]
1211+ event_dict = test_processor .call_args_list [0 ].args [2 ]
12131212
12141213 assert MyError is event_dict ["exc_info" ][0 ]
12151214
@@ -1232,9 +1231,9 @@ def test_other_handlers_get_original_record(self):
12321231
12331232 logger .info ("meh" )
12341233
1235- assert 1 == len (handler2 .handle .calls )
1234+ assert 1 == len (handler2 .handle .call_args_list )
12361235
1237- handler2_record = handler2 .handle .calls [0 ].args [0 ]
1236+ handler2_record = handler2 .handle .call_args_list [0 ].args [0 ]
12381237
12391238 assert "meh" == handler2_record .msg
12401239
0 commit comments