Show More
@@ -451,7 +451,13 b' class ExecutionMagics(Magics):' | |||
|
451 | 451 | |
|
452 | 452 | if not (args.breakpoint or args.statement or cell): |
|
453 | 453 | self._debug_post_mortem() |
|
454 | elif not (args.breakpoint or cell): | |
|
455 | # If there is no breakpoints, the line is just code to execute | |
|
456 | self._debug_exec(line, None) | |
|
454 | 457 | else: |
|
458 | # Here we try to reconstruct the code from the output of | |
|
459 | # parse_argstring. This might not work if the code has spaces | |
|
460 | # For example this fails for `print("a b")` | |
|
455 | 461 | code = "\n".join(args.statement) |
|
456 | 462 | if cell: |
|
457 | 463 | code += "\n" + cell |
@@ -32,6 +32,7 b' from IPython.utils.io import capture_output' | |||
|
32 | 32 | from IPython.utils.tempdir import (TemporaryDirectory, |
|
33 | 33 | TemporaryWorkingDirectory) |
|
34 | 34 | from IPython.utils.process import find_cmd |
|
35 | from .test_debugger import PdbTestInput | |
|
35 | 36 | |
|
36 | 37 | |
|
37 | 38 | @magic.magics_class |
@@ -599,6 +600,18 b' def doctest_precision():' | |||
|
599 | 600 | Out[5]: '3.141593e+00' |
|
600 | 601 | """ |
|
601 | 602 | |
|
603 | def test_debug_magic(): | |
|
604 | """Test debugging a small code with %debug | |
|
605 | ||
|
606 | In [1]: with PdbTestInput(['c']): | |
|
607 | ...: %debug print("a b") #doctest: +ELLIPSIS | |
|
608 | ...: | |
|
609 | ... | |
|
610 | ipdb> c | |
|
611 | a b | |
|
612 | In [2]: | |
|
613 | """ | |
|
614 | ||
|
602 | 615 | def test_psearch(): |
|
603 | 616 | with tt.AssertPrints("dict.fromkeys"): |
|
604 | 617 | _ip.run_cell("dict.fr*?") |
General Comments 0
You need to be logged in to leave comments.
Login now