Closed
Description
Running any of TraceOpcodesTestCase tests from test_sys_settrace always fails. For example:
$ ./python -m test -v test_sys_settrace -m test.test_sys_settrace.TraceOpcodesTestCase.test_01_basic
...
test_01_basic (test.test_sys_settrace.TraceOpcodesTestCase.test_01_basic) ... FAIL
======================================================================
FAIL: test_01_basic (test.test_sys_settrace.TraceOpcodesTestCase.test_01_basic)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/serhiy/py/cpython/Lib/test/test_sys_settrace.py", line 388, in test_01_basic
self.run_test(basic)
File "/home/serhiy/py/cpython/Lib/test/test_sys_settrace.py", line 364, in run_test
self.run_and_compare(func, func.events)
File "/home/serhiy/py/cpython/Lib/test/test_sys_settrace.py", line 360, in run_and_compare
self.compare_events(func.__code__.co_firstlineno,
File "/home/serhiy/py/cpython/Lib/test/test_sys_settrace.py", line 1745, in compare_events
self.assertLess(len(skip_opcode_events), len(events),
AssertionError: 3 not less than 3 : No 'opcode' events received by the tracer
...
Running several of TraceOpcodesTestCase tests only fails the first of them.
Running also RaisingTraceFuncTestCase.test_line_event_raises_before_opcode_event
makes the tests passing successfully.
$ ./python -m test -v test_sys_settrace -m test.test_sys_settrace.TraceOpcodesTestCase.test_01_basic -m test_line_event_raises_before_opcode_event
...
test_line_event_raises_before_opcode_event (test.test_sys_settrace.RaisingTraceFuncTestCase.test_line_event_raises_before_opcode_event) ... ok
test_01_basic (test.test_sys_settrace.TraceOpcodesTestCase.test_01_basic) ... ok
...