Skip to content

Commit 67a74cd

Browse files
authored
Show function qualname (#95)
1 parent bb413fb commit 67a74cd

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

devtools/debug.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def _process(self, args, kwargs) -> DebugOutput:
166166
arguments = list(self._args_inspection_failed(args, kwargs))
167167
else:
168168
ex = source.executing(call_frame)
169-
# function = ex.code_qualname()
169+
function = ex.code_qualname()
170170
if not ex.node:
171171
warning = "executing failed to find the calling node"
172172
arguments = list(self._args_inspection_failed(args, kwargs))

tests/test_expr_render.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def func():
192192
# check only the original code is included in the warning
193193
s = normalise_output(str(v))
194194
assert s == (
195-
'tests/test_expr_render.py:<line no> func\n'
195+
'tests/test_expr_render.py:<line no> test_very_nested_last_statement.<locals>.func\n'
196196
' abs( abs( abs( abs( -1 ) ) ) ): 1 (int)'
197197
)
198198

@@ -217,7 +217,7 @@ def func():
217217
# check only the original code is included in the warning
218218
s = normalise_output(str(v))
219219
assert s == (
220-
'tests/test_expr_render.py:<line no> func\n'
220+
'tests/test_expr_render.py:<line no> test_syntax_warning.<locals>.func\n'
221221
' abs( abs( abs( abs( abs( -1 ) ) ) ) ): 1 (int)'
222222
)
223223

@@ -244,7 +244,7 @@ def func():
244244
v = func()
245245
s = normalise_output(str(v))
246246
assert s == (
247-
'tests/test_expr_render.py:<line no> func\n'
247+
'tests/test_expr_render.py:<line no> test_no_syntax_warning.<locals>.func\n'
248248
' abs( abs( abs( abs( abs( -1 ) ) ) ) ): 1 (int)'
249249
)
250250

@@ -261,7 +261,7 @@ async def bar():
261261
loop.close()
262262
s = normalise_output(str(v))
263263
assert (
264-
'tests/test_expr_render.py:<line no> bar\n'
264+
'tests/test_expr_render.py:<line no> test_await.<locals>.bar\n'
265265
' await foo(): 1 (int)'
266266
) == s
267267

0 commit comments

Comments
 (0)