Skip to content

Commit 9779f96

Browse files
committed
Fix bad pragma and comparison in trace_function
1 parent cffdf71 commit 9779f96

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pytest_describe/plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
PYTEST_GTE_5_4 = PYTEST_GTE_7_0 or hasattr(pytest.Collector, 'from_parent')
1010

1111

12-
def trace_function(func, *args, **kwargs): # pragma: no-cover
12+
def trace_function(func, *args, **kwargs):
1313
"""Call a function and return its locals."""
1414
f_locals = {}
1515

1616
def _trace_func(frame, event, arg): # pragma: no cover
1717
# Activate local trace for first call only
18-
if (frame.f_back.f_locals.get('_trace_func') == _trace_func
18+
if (frame.f_back.f_locals.get('_trace_func') is _trace_func
1919
and event == 'return'):
2020
f_locals.update(frame.f_locals)
2121

0 commit comments

Comments
 (0)