Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add a failing test for "%run -d -m ..."

  • Loading branch information...
commit 5b85b646494f2ea95b2a2f5cc6aa61199677e250 1 parent e14ceec
@tkf authored
Showing with 17 additions and 0 deletions.
  1. +17 −0 IPython/core/tests/test_run.py
View
17 IPython/core/tests/test_run.py
@@ -19,6 +19,7 @@
import unittest
import textwrap
import random
+import functools
import nose.tools as nt
from nose import SkipTest
@@ -27,6 +28,7 @@
from IPython.testing import tools as tt
from IPython.utils import py3compat
from IPython.utils.tempdir import TemporaryDirectory
+from IPython.core import debugger
#-----------------------------------------------------------------------------
# Test functions begin
@@ -397,3 +399,18 @@ def test_prun_submodule_with_absolute_import(self):
def test_prun_submodule_with_relative_import(self):
self.check_run_submodule('relative', '-p')
+
+ def with_fake_debugger(func):
+ @functools.wraps(func)
+ def wrapper(*args, **kwds):
+ with tt.monkeypatch(debugger.Pdb, 'run', staticmethod(eval)):
+ return func(*args, **kwds)
+ return wrapper
+
+ @with_fake_debugger
+ def test_debug_run_submodule_with_absolute_import(self):
+ self.check_run_submodule('absolute', '-d')
+
+ @with_fake_debugger
+ def test_debug_run_submodule_with_relative_import(self):
+ self.check_run_submodule('relative', '-d')
Please sign in to comment.
Something went wrong with that request. Please try again.