From 3b679692715590b0867d09a497b20c261554c0f9 2013-09-18 16:26:32 From: Thomas Kluyver Date: 2013-09-18 16:26:32 Subject: [PATCH] Make tests for '%run -m' more robust --- diff --git a/IPython/core/tests/test_run.py b/IPython/core/tests/test_run.py index 9ec10f2..cc11ac6 100644 --- a/IPython/core/tests/test_run.py +++ b/IPython/core/tests/test_run.py @@ -398,6 +398,7 @@ class TestMagicRunWithPackage(unittest.TestCase): self.tempdir.cleanup() def check_run_submodule(self, submodule, opts=''): + _ip.user_ns.pop('x', None) _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}`.'