PageRenderTime 56ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/lib-python/2/test/test_sys_settrace.py

https://bitbucket.org/kcr/pypy
Python | 800 lines | 694 code | 63 blank | 43 comment | 45 complexity | 2ca4b1048653eb57124e8980f084c7ca MD5 | raw file
Possible License(s): Apache-2.0
  1. # Testing the line trace facility.
  2. from test import test_support
  3. import unittest
  4. import sys
  5. import difflib
  6. import gc
  7. # A very basic example. If this fails, we're in deep trouble.
  8. def basic():
  9. return 1
  10. basic.events = [(0, 'call'),
  11. (1, 'line'),
  12. (1, 'return')]
  13. # Many of the tests below are tricky because they involve pass statements.
  14. # If there is implicit control flow around a pass statement (in an except
  15. # clause or else caluse) under what conditions do you set a line number
  16. # following that clause?
  17. # The entire "while 0:" statement is optimized away. No code
  18. # exists for it, so the line numbers skip directly from "del x"
  19. # to "x = 1".
  20. def arigo_example():
  21. x = 1
  22. del x
  23. while 0:
  24. pass
  25. x = 1
  26. arigo_example.events = [(0, 'call'),
  27. (1, 'line'),
  28. (2, 'line'),
  29. (5, 'line'),
  30. (5, 'return')]
  31. # check that lines consisting of just one instruction get traced:
  32. def one_instr_line():
  33. x = 1
  34. del x
  35. x = 1
  36. one_instr_line.events = [(0, 'call'),
  37. (1, 'line'),
  38. (2, 'line'),
  39. (3, 'line'),
  40. (3, 'return')]
  41. def no_pop_tops(): # 0
  42. x = 1 # 1
  43. for a in range(2): # 2
  44. if a: # 3
  45. x = 1 # 4
  46. else: # 5
  47. x = 1 # 6
  48. no_pop_tops.events = [(0, 'call'),
  49. (1, 'line'),
  50. (2, 'line'),
  51. (3, 'line'),
  52. (6, 'line'),
  53. (2, 'line'),
  54. (3, 'line'),
  55. (4, 'line'),
  56. (2, 'line'),
  57. (2, 'return')]
  58. def no_pop_blocks():
  59. y = 1
  60. while not y:
  61. bla
  62. x = 1
  63. no_pop_blocks.events = [(0, 'call'),
  64. (1, 'line'),
  65. (2, 'line'),
  66. (4, 'line'),
  67. (4, 'return')]
  68. def called(): # line -3
  69. x = 1
  70. def call(): # line 0
  71. called()
  72. call.events = [(0, 'call'),
  73. (1, 'line'),
  74. (-3, 'call'),
  75. (-2, 'line'),
  76. (-2, 'return'),
  77. (1, 'return')]
  78. def raises():
  79. raise Exception
  80. def test_raise():
  81. try:
  82. raises()
  83. except Exception, exc:
  84. x = 1
  85. test_raise.events = [(0, 'call'),
  86. (1, 'line'),
  87. (2, 'line'),
  88. (-3, 'call'),
  89. (-2, 'line'),
  90. (-2, 'exception'),
  91. (-2, 'return'),
  92. (2, 'exception'),
  93. (3, 'line'),
  94. (4, 'line'),
  95. (4, 'return')]
  96. def _settrace_and_return(tracefunc):
  97. sys.settrace(tracefunc)
  98. sys._getframe().f_back.f_trace = tracefunc
  99. def settrace_and_return(tracefunc):
  100. _settrace_and_return(tracefunc)
  101. settrace_and_return.events = [(1, 'return')]
  102. def _settrace_and_raise(tracefunc):
  103. sys.settrace(tracefunc)
  104. sys._getframe().f_back.f_trace = tracefunc
  105. raise RuntimeError
  106. def settrace_and_raise(tracefunc):
  107. try:
  108. _settrace_and_raise(tracefunc)
  109. except RuntimeError, exc:
  110. pass
  111. settrace_and_raise.events = [(2, 'exception'),
  112. (3, 'line'),
  113. (4, 'line'),
  114. (4, 'return')]
  115. # implicit return example
  116. # This test is interesting because of the else: pass
  117. # part of the code. The code generate for the true
  118. # part of the if contains a jump past the else branch.
  119. # The compiler then generates an implicit "return None"
  120. # Internally, the compiler visits the pass statement
  121. # and stores its line number for use on the next instruction.
  122. # The next instruction is the implicit return None.
  123. def ireturn_example():
  124. a = 5
  125. b = 5
  126. if a == b:
  127. b = a+1
  128. else:
  129. pass
  130. ireturn_example.events = [(0, 'call'),
  131. (1, 'line'),
  132. (2, 'line'),
  133. (3, 'line'),
  134. (4, 'line'),
  135. (6, 'line'),
  136. (6, 'return')]
  137. # Tight loop with while(1) example (SF #765624)
  138. def tightloop_example():
  139. items = range(0, 3)
  140. try:
  141. i = 0
  142. while 1:
  143. b = items[i]; i+=1
  144. except IndexError:
  145. pass
  146. tightloop_example.events = [(0, 'call'),
  147. (1, 'line'),
  148. (2, 'line'),
  149. (3, 'line'),
  150. (4, 'line'),
  151. (5, 'line'),
  152. (5, 'line'),
  153. (5, 'line'),
  154. (5, 'line'),
  155. (5, 'exception'),
  156. (6, 'line'),
  157. (7, 'line'),
  158. (7, 'return')]
  159. def tighterloop_example():
  160. items = range(1, 4)
  161. try:
  162. i = 0
  163. while 1: i = items[i]
  164. except IndexError:
  165. pass
  166. tighterloop_example.events = [(0, 'call'),
  167. (1, 'line'),
  168. (2, 'line'),
  169. (3, 'line'),
  170. (4, 'line'),
  171. (4, 'line'),
  172. (4, 'line'),
  173. (4, 'line'),
  174. (4, 'exception'),
  175. (5, 'line'),
  176. (6, 'line'),
  177. (6, 'return')]
  178. def generator_function():
  179. try:
  180. yield True
  181. "continued"
  182. finally:
  183. "finally"
  184. def generator_example():
  185. # any() will leave the generator before its end
  186. x = any(generator_function()); gc.collect()
  187. # the following lines were not traced
  188. for x in range(10):
  189. y = x
  190. # On CPython, when the generator is decref'ed to zero, we see the trace
  191. # for the "finally:" portion. On PyPy, we don't see it before the next
  192. # garbage collection. That's why we put gc.collect() on the same line above.
  193. generator_example.events = ([(0, 'call'),
  194. (2, 'line'),
  195. (-6, 'call'),
  196. (-5, 'line'),
  197. (-4, 'line'),
  198. (-4, 'return'),
  199. (-4, 'call'),
  200. (-4, 'exception'),
  201. (-1, 'line'),
  202. (-1, 'return')] +
  203. [(5, 'line'), (6, 'line')] * 10 +
  204. [(5, 'line'), (5, 'return')])
  205. class Tracer:
  206. def __init__(self):
  207. self.events = []
  208. def trace(self, frame, event, arg):
  209. self.events.append((frame.f_lineno, event))
  210. return self.trace
  211. def traceWithGenexp(self, frame, event, arg):
  212. (o for o in [1])
  213. self.events.append((frame.f_lineno, event))
  214. return self.trace
  215. class TraceTestCase(unittest.TestCase):
  216. # Disable gc collection when tracing, otherwise the
  217. # deallocators may be traced as well.
  218. def setUp(self):
  219. self.using_gc = gc.isenabled()
  220. gc.disable()
  221. def tearDown(self):
  222. if self.using_gc:
  223. gc.enable()
  224. def compare_events(self, line_offset, events, expected_events):
  225. events = [(l - line_offset, e) for (l, e) in events]
  226. if events != expected_events:
  227. self.fail(
  228. "events did not match expectation:\n" +
  229. "\n".join(difflib.ndiff([str(x) for x in expected_events],
  230. [str(x) for x in events])))
  231. def run_and_compare(self, func, events):
  232. tracer = Tracer()
  233. sys.settrace(tracer.trace)
  234. func()
  235. sys.settrace(None)
  236. self.compare_events(func.func_code.co_firstlineno,
  237. tracer.events, events)
  238. def run_test(self, func):
  239. self.run_and_compare(func, func.events)
  240. def run_test2(self, func):
  241. tracer = Tracer()
  242. func(tracer.trace)
  243. sys.settrace(None)
  244. self.compare_events(func.func_code.co_firstlineno,
  245. tracer.events, func.events)
  246. def test_set_and_retrieve_none(self):
  247. sys.settrace(None)
  248. assert sys.gettrace() is None
  249. def test_set_and_retrieve_func(self):
  250. def fn(*args):
  251. pass
  252. sys.settrace(fn)
  253. try:
  254. assert sys.gettrace() is fn
  255. finally:
  256. sys.settrace(None)
  257. def test_01_basic(self):
  258. self.run_test(basic)
  259. def test_02_arigo(self):
  260. self.run_test(arigo_example)
  261. def test_03_one_instr(self):
  262. self.run_test(one_instr_line)
  263. def test_04_no_pop_blocks(self):
  264. self.run_test(no_pop_blocks)
  265. def test_05_no_pop_tops(self):
  266. self.run_test(no_pop_tops)
  267. def test_06_call(self):
  268. self.run_test(call)
  269. def test_07_raise(self):
  270. self.run_test(test_raise)
  271. def test_08_settrace_and_return(self):
  272. self.run_test2(settrace_and_return)
  273. def test_09_settrace_and_raise(self):
  274. self.run_test2(settrace_and_raise)
  275. def test_10_ireturn(self):
  276. self.run_test(ireturn_example)
  277. def test_11_tightloop(self):
  278. self.run_test(tightloop_example)
  279. def test_12_tighterloop(self):
  280. self.run_test(tighterloop_example)
  281. def test_13_genexp(self):
  282. if self.using_gc:
  283. test_support.gc_collect()
  284. gc.enable()
  285. try:
  286. self.run_test(generator_example)
  287. # issue1265: if the trace function contains a generator,
  288. # and if the traced function contains another generator
  289. # that is not completely exhausted, the trace stopped.
  290. # Worse: the 'finally' clause was not invoked.
  291. tracer = Tracer()
  292. sys.settrace(tracer.traceWithGenexp)
  293. generator_example()
  294. sys.settrace(None)
  295. self.compare_events(generator_example.__code__.co_firstlineno,
  296. tracer.events, generator_example.events)
  297. finally:
  298. if self.using_gc:
  299. gc.disable()
  300. def test_14_onliner_if(self):
  301. def onliners():
  302. if True: False
  303. else: True
  304. return 0
  305. self.run_and_compare(
  306. onliners,
  307. [(0, 'call'),
  308. (1, 'line'),
  309. (3, 'line'),
  310. (3, 'return')])
  311. def test_15_loops(self):
  312. # issue1750076: "while" expression is skipped by debugger
  313. def for_example():
  314. for x in range(2):
  315. pass
  316. self.run_and_compare(
  317. for_example,
  318. [(0, 'call'),
  319. (1, 'line'),
  320. (2, 'line'),
  321. (1, 'line'),
  322. (2, 'line'),
  323. (1, 'line'),
  324. (1, 'return')])
  325. def while_example():
  326. # While expression should be traced on every loop
  327. x = 2
  328. while x > 0:
  329. x -= 1
  330. self.run_and_compare(
  331. while_example,
  332. [(0, 'call'),
  333. (2, 'line'),
  334. (3, 'line'),
  335. (4, 'line'),
  336. (3, 'line'),
  337. (4, 'line'),
  338. (3, 'line'),
  339. (3, 'return')])
  340. def test_16_blank_lines(self):
  341. exec("def f():\n" + "\n" * 256 + " pass")
  342. self.run_and_compare(
  343. f,
  344. [(0, 'call'),
  345. (257, 'line'),
  346. (257, 'return')])
  347. class RaisingTraceFuncTestCase(unittest.TestCase):
  348. def trace(self, frame, event, arg):
  349. """A trace function that raises an exception in response to a
  350. specific trace event."""
  351. if event == self.raiseOnEvent:
  352. raise ValueError # just something that isn't RuntimeError
  353. else:
  354. return self.trace
  355. def f(self):
  356. """The function to trace; raises an exception if that's the case
  357. we're testing, so that the 'exception' trace event fires."""
  358. if self.raiseOnEvent == 'exception':
  359. x = 0
  360. y = 1 // x
  361. else:
  362. return 1
  363. def run_test_for_event(self, event):
  364. """Tests that an exception raised in response to the given event is
  365. handled OK."""
  366. self.raiseOnEvent = event
  367. try:
  368. for i in xrange(sys.getrecursionlimit() + 1):
  369. sys.settrace(self.trace)
  370. try:
  371. self.f()
  372. except ValueError:
  373. pass
  374. else:
  375. self.fail("exception not thrown!")
  376. except RuntimeError:
  377. self.fail("recursion counter not reset")
  378. # Test the handling of exceptions raised by each kind of trace event.
  379. def test_call(self):
  380. self.run_test_for_event('call')
  381. def test_line(self):
  382. self.run_test_for_event('line')
  383. def test_return(self):
  384. self.run_test_for_event('return')
  385. def test_exception(self):
  386. self.run_test_for_event('exception')
  387. def test_trash_stack(self):
  388. def f():
  389. for i in range(5):
  390. print i # line tracing will raise an exception at this line
  391. def g(frame, why, extra):
  392. if (why == 'line' and
  393. frame.f_lineno == f.func_code.co_firstlineno + 2):
  394. raise RuntimeError, "i am crashing"
  395. return g
  396. sys.settrace(g)
  397. try:
  398. f()
  399. except RuntimeError:
  400. # the test is really that this doesn't segfault:
  401. import gc
  402. gc.collect()
  403. else:
  404. self.fail("exception not propagated")
  405. # 'Jump' tests: assigning to frame.f_lineno within a trace function
  406. # moves the execution position - it's how debuggers implement a Jump
  407. # command (aka. "Set next statement").
  408. class JumpTracer:
  409. """Defines a trace function that jumps from one place to another,
  410. with the source and destination lines of the jump being defined by
  411. the 'jump' property of the function under test."""
  412. def __init__(self, function):
  413. self.function = function
  414. self.jumpFrom = function.jump[0]
  415. self.jumpTo = function.jump[1]
  416. self.done = False
  417. def trace(self, frame, event, arg):
  418. if not self.done and frame.f_code == self.function.func_code:
  419. firstLine = frame.f_code.co_firstlineno
  420. if event == 'line' and frame.f_lineno == firstLine + self.jumpFrom:
  421. # Cope with non-integer self.jumpTo (because of
  422. # no_jump_to_non_integers below).
  423. try:
  424. frame.f_lineno = firstLine + self.jumpTo
  425. except TypeError:
  426. frame.f_lineno = self.jumpTo
  427. self.done = True
  428. return self.trace
  429. # The first set of 'jump' tests are for things that are allowed:
  430. def jump_simple_forwards(output):
  431. output.append(1)
  432. output.append(2)
  433. output.append(3)
  434. jump_simple_forwards.jump = (1, 3)
  435. jump_simple_forwards.output = [3]
  436. def jump_simple_backwards(output):
  437. output.append(1)
  438. output.append(2)
  439. jump_simple_backwards.jump = (2, 1)
  440. jump_simple_backwards.output = [1, 1, 2]
  441. def jump_out_of_block_forwards(output):
  442. for i in 1, 2:
  443. output.append(2)
  444. for j in [3]: # Also tests jumping over a block
  445. output.append(4)
  446. output.append(5)
  447. jump_out_of_block_forwards.jump = (3, 5)
  448. jump_out_of_block_forwards.output = [2, 5]
  449. def jump_out_of_block_backwards(output):
  450. output.append(1)
  451. for i in [1]:
  452. output.append(3)
  453. for j in [2]: # Also tests jumping over a block
  454. output.append(5)
  455. output.append(6)
  456. output.append(7)
  457. jump_out_of_block_backwards.jump = (6, 1)
  458. jump_out_of_block_backwards.output = [1, 3, 5, 1, 3, 5, 6, 7]
  459. def jump_to_codeless_line(output):
  460. output.append(1)
  461. # Jumping to this line should skip to the next one.
  462. output.append(3)
  463. jump_to_codeless_line.jump = (1, 2)
  464. jump_to_codeless_line.output = [3]
  465. def jump_to_same_line(output):
  466. output.append(1)
  467. output.append(2)
  468. output.append(3)
  469. jump_to_same_line.jump = (2, 2)
  470. jump_to_same_line.output = [1, 2, 3]
  471. # Tests jumping within a finally block, and over one.
  472. def jump_in_nested_finally(output):
  473. try:
  474. output.append(2)
  475. finally:
  476. output.append(4)
  477. try:
  478. output.append(6)
  479. finally:
  480. output.append(8)
  481. output.append(9)
  482. jump_in_nested_finally.jump = (4, 9)
  483. jump_in_nested_finally.output = [2, 9]
  484. # The second set of 'jump' tests are for things that are not allowed:
  485. def no_jump_too_far_forwards(output):
  486. try:
  487. output.append(2)
  488. output.append(3)
  489. except ValueError, e:
  490. output.append('after' in str(e))
  491. no_jump_too_far_forwards.jump = (3, 6)
  492. no_jump_too_far_forwards.output = [2, True]
  493. def no_jump_too_far_backwards(output):
  494. try:
  495. output.append(2)
  496. output.append(3)
  497. except ValueError, e:
  498. output.append('before' in str(e))
  499. no_jump_too_far_backwards.jump = (3, -1)
  500. no_jump_too_far_backwards.output = [2, True]
  501. # Test each kind of 'except' line.
  502. def no_jump_to_except_1(output):
  503. try:
  504. output.append(2)
  505. except:
  506. e = sys.exc_info()[1]
  507. output.append('except' in str(e))
  508. no_jump_to_except_1.jump = (2, 3)
  509. no_jump_to_except_1.output = [True]
  510. def no_jump_to_except_2(output):
  511. try:
  512. output.append(2)
  513. except ValueError:
  514. e = sys.exc_info()[1]
  515. output.append('except' in str(e))
  516. no_jump_to_except_2.jump = (2, 3)
  517. no_jump_to_except_2.output = [True]
  518. def no_jump_to_except_3(output):
  519. try:
  520. output.append(2)
  521. except ValueError, e:
  522. output.append('except' in str(e))
  523. no_jump_to_except_3.jump = (2, 3)
  524. no_jump_to_except_3.output = [True]
  525. def no_jump_to_except_4(output):
  526. try:
  527. output.append(2)
  528. except (ValueError, RuntimeError), e:
  529. output.append('except' in str(e))
  530. no_jump_to_except_4.jump = (2, 3)
  531. no_jump_to_except_4.output = [True]
  532. def no_jump_forwards_into_block(output):
  533. try:
  534. output.append(2)
  535. for i in 1, 2:
  536. output.append(4)
  537. except ValueError, e:
  538. output.append('into' in str(e))
  539. no_jump_forwards_into_block.jump = (2, 4)
  540. no_jump_forwards_into_block.output = [True]
  541. def no_jump_backwards_into_block(output):
  542. try:
  543. for i in 1, 2:
  544. output.append(3)
  545. output.append(4)
  546. except ValueError, e:
  547. output.append('into' in str(e))
  548. no_jump_backwards_into_block.jump = (4, 3)
  549. no_jump_backwards_into_block.output = [3, 3, True]
  550. def no_jump_into_finally_block(output):
  551. try:
  552. try:
  553. output.append(3)
  554. x = 1
  555. finally:
  556. output.append(6)
  557. except ValueError, e:
  558. output.append('finally' in str(e))
  559. no_jump_into_finally_block.jump = (4, 6)
  560. no_jump_into_finally_block.output = [3, 6, True] # The 'finally' still runs
  561. def no_jump_out_of_finally_block(output):
  562. try:
  563. try:
  564. output.append(3)
  565. finally:
  566. output.append(5)
  567. output.append(6)
  568. except ValueError, e:
  569. output.append('finally' in str(e))
  570. no_jump_out_of_finally_block.jump = (5, 1)
  571. no_jump_out_of_finally_block.output = [3, True]
  572. # This verifies the line-numbers-must-be-integers rule.
  573. def no_jump_to_non_integers(output):
  574. try:
  575. output.append(2)
  576. except ValueError, e:
  577. output.append('integer' in str(e))
  578. no_jump_to_non_integers.jump = (2, "Spam")
  579. no_jump_to_non_integers.output = [True]
  580. # This verifies that you can't set f_lineno via _getframe or similar
  581. # trickery.
  582. def no_jump_without_trace_function():
  583. try:
  584. previous_frame = sys._getframe().f_back
  585. previous_frame.f_lineno = previous_frame.f_lineno
  586. except ValueError, e:
  587. # This is the exception we wanted; make sure the error message
  588. # talks about trace functions.
  589. if 'trace' not in str(e):
  590. raise
  591. else:
  592. # Something's wrong - the expected exception wasn't raised.
  593. raise RuntimeError, "Trace-function-less jump failed to fail"
  594. class JumpTestCase(unittest.TestCase):
  595. def compare_jump_output(self, expected, received):
  596. if received != expected:
  597. self.fail( "Outputs don't match:\n" +
  598. "Expected: " + repr(expected) + "\n" +
  599. "Received: " + repr(received))
  600. def run_test(self, func):
  601. tracer = JumpTracer(func)
  602. sys.settrace(tracer.trace)
  603. output = []
  604. func(output)
  605. sys.settrace(None)
  606. self.compare_jump_output(func.output, output)
  607. def test_01_jump_simple_forwards(self):
  608. self.run_test(jump_simple_forwards)
  609. def test_02_jump_simple_backwards(self):
  610. self.run_test(jump_simple_backwards)
  611. def test_03_jump_out_of_block_forwards(self):
  612. self.run_test(jump_out_of_block_forwards)
  613. def test_04_jump_out_of_block_backwards(self):
  614. self.run_test(jump_out_of_block_backwards)
  615. def test_05_jump_to_codeless_line(self):
  616. self.run_test(jump_to_codeless_line)
  617. def test_06_jump_to_same_line(self):
  618. self.run_test(jump_to_same_line)
  619. def test_07_jump_in_nested_finally(self):
  620. self.run_test(jump_in_nested_finally)
  621. def test_08_no_jump_too_far_forwards(self):
  622. self.run_test(no_jump_too_far_forwards)
  623. def test_09_no_jump_too_far_backwards(self):
  624. self.run_test(no_jump_too_far_backwards)
  625. def test_10_no_jump_to_except_1(self):
  626. self.run_test(no_jump_to_except_1)
  627. def test_11_no_jump_to_except_2(self):
  628. self.run_test(no_jump_to_except_2)
  629. def test_12_no_jump_to_except_3(self):
  630. self.run_test(no_jump_to_except_3)
  631. def test_13_no_jump_to_except_4(self):
  632. self.run_test(no_jump_to_except_4)
  633. def test_14_no_jump_forwards_into_block(self):
  634. self.run_test(no_jump_forwards_into_block)
  635. def test_15_no_jump_backwards_into_block(self):
  636. self.run_test(no_jump_backwards_into_block)
  637. def test_16_no_jump_into_finally_block(self):
  638. self.run_test(no_jump_into_finally_block)
  639. def test_17_no_jump_out_of_finally_block(self):
  640. self.run_test(no_jump_out_of_finally_block)
  641. def test_18_no_jump_to_non_integers(self):
  642. self.run_test(no_jump_to_non_integers)
  643. def test_19_no_jump_without_trace_function(self):
  644. no_jump_without_trace_function()
  645. def test_20_large_function(self):
  646. d = {}
  647. exec("""def f(output): # line 0
  648. x = 0 # line 1
  649. y = 1 # line 2
  650. ''' # line 3
  651. %s # lines 4-1004
  652. ''' # line 1005
  653. x += 1 # line 1006
  654. output.append(x) # line 1007
  655. return""" % ('\n' * 1000,), d)
  656. f = d['f']
  657. f.jump = (2, 1007)
  658. f.output = [0]
  659. self.run_test(f)
  660. def test_jump_to_firstlineno(self):
  661. # This tests that PDB can jump back to the first line in a
  662. # file. See issue #1689458. It can only be triggered in a
  663. # function call if the function is defined on a single line.
  664. code = compile("""
  665. # Comments don't count.
  666. output.append(2) # firstlineno is here.
  667. output.append(3)
  668. output.append(4)
  669. """, "<fake module>", "exec")
  670. class fake_function:
  671. func_code = code
  672. jump = (2, 0)
  673. tracer = JumpTracer(fake_function)
  674. sys.settrace(tracer.trace)
  675. namespace = {"output": []}
  676. exec code in namespace
  677. sys.settrace(None)
  678. self.compare_jump_output([2, 3, 2, 3, 4], namespace["output"])
  679. def test_main():
  680. test_support.run_unittest(
  681. TraceTestCase,
  682. RaisingTraceFuncTestCase,
  683. JumpTestCase
  684. )
  685. if __name__ == "__main__":
  686. test_main()