File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -137,21 +137,17 @@ def test_no_stack_info_by_default(self):
137
137
138
138
assert None is stack_info
139
139
140
- def test_find_caller (self , monkeypatch ):
140
+ def test_find_caller (self , caplog ):
141
141
"""
142
142
The caller is found.
143
143
"""
144
144
logger = LoggerFactory ()()
145
- log_handle = call_recorder (lambda x : None )
146
- monkeypatch .setattr (logger , "handle" , log_handle )
147
145
148
146
logger .error ("Test" )
149
147
150
- log_record = log_handle .calls [0 ].args [0 ]
151
-
152
- assert log_record .funcName == "test_find_caller"
153
- assert log_record .name == __name__
154
- assert log_record .filename == os .path .basename (__file__ )
148
+ assert caplog .text .startswith (
149
+ "ERROR tests.test_stdlib:test_stdlib.py"
150
+ )
155
151
156
152
def test_sets_correct_logger (self ):
157
153
"""
You can’t perform that action at this time.
0 commit comments