Permalink
Browse files

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

  • Loading branch information...
1 parent 4103901 commit c809a13f6dd569cccef2a69f65610ac14b528f22 @tkf committed Mar 23, 2013
Showing with 8 additions and 2 deletions.
  1. +8 −2 IPython/core/tests/test_run.py
@@ -379,8 +379,8 @@ def tearDown(self):
sys.path[:] = filter(lambda x: x != self.tempdir.name, sys.path)
self.tempdir.cleanup()
- def check_run_submodule(self, submodule):
- _ip.magic('run -m {0}.{1}'.format(self.package, submodule))
+ def check_run_submodule(self, submodule, opts=''):
+ _ip.magic('run {2} -m {0}.{1}'.format(self.package, submodule, opts))
self.assertEqual(_ip.user_ns['x'], self.value,
'Variable `x` is not loaded from module `{0}`.'
.format(submodule))
@@ -391,3 +391,9 @@ def test_run_submodule_with_absolute_import(self):
def test_run_submodule_with_relative_import(self):
"""Run submodule that has a relative import statement (#2727)."""
self.check_run_submodule('relative')
+
+ def test_prun_submodule_with_absolute_import(self):
+ self.check_run_submodule('absolute', '-p')
+
+ def test_prun_submodule_with_relative_import(self):
+ self.check_run_submodule('relative', '-p')

0 comments on commit c809a13

Please sign in to comment.