Show More
@@ -19,6 +19,7 b' import tempfile' | |||
|
19 | 19 | import unittest |
|
20 | 20 | import textwrap |
|
21 | 21 | import random |
|
22 | import functools | |
|
22 | 23 | |
|
23 | 24 | import nose.tools as nt |
|
24 | 25 | from nose import SkipTest |
@@ -27,6 +28,7 b' from IPython.testing import decorators as dec' | |||
|
27 | 28 | from IPython.testing import tools as tt |
|
28 | 29 | from IPython.utils import py3compat |
|
29 | 30 | from IPython.utils.tempdir import TemporaryDirectory |
|
31 | from IPython.core import debugger | |
|
30 | 32 | |
|
31 | 33 | #----------------------------------------------------------------------------- |
|
32 | 34 | # Test functions begin |
@@ -397,3 +399,18 b' class TestMagicRunWithPackage(unittest.TestCase):' | |||
|
397 | 399 | |
|
398 | 400 | def test_prun_submodule_with_relative_import(self): |
|
399 | 401 | self.check_run_submodule('relative', '-p') |
|
402 | ||
|
403 | def with_fake_debugger(func): | |
|
404 | @functools.wraps(func) | |
|
405 | def wrapper(*args, **kwds): | |
|
406 | with tt.monkeypatch(debugger.Pdb, 'run', staticmethod(eval)): | |
|
407 | return func(*args, **kwds) | |
|
408 | return wrapper | |
|
409 | ||
|
410 | @with_fake_debugger | |
|
411 | def test_debug_run_submodule_with_absolute_import(self): | |
|
412 | self.check_run_submodule('absolute', '-d') | |
|
413 | ||
|
414 | @with_fake_debugger | |
|
415 | def test_debug_run_submodule_with_relative_import(self): | |
|
416 | self.check_run_submodule('relative', '-d') |
General Comments 0
You need to be logged in to leave comments.
Login now