From 2ab1552e37685765f8d1095c0ea0d0b2285dec9b 2013-07-13 12:53:12 From: Thomas Kluyver Date: 2013-07-13 12:53:12 Subject: [PATCH] Fix test for Python 3 on Windows. IPython.core.tests.test_run.test_aggressive_namespace_cleanup --- diff --git a/IPython/core/tests/test_run.py b/IPython/core/tests/test_run.py index 03e781f..9ec10f2 100644 --- a/IPython/core/tests/test_run.py +++ b/IPython/core/tests/test_run.py @@ -252,13 +252,15 @@ class TestMagicRunSimple(tt.TempFileMixin): class secondtmp(tt.TempFileMixin): pass empty = secondtmp() empty.mktmp('') + # On Windows, the filename will have \users in it, so we need to use the + # repr so that the \u becomes \\u. src = ("ip = get_ipython()\n" "for i in range(5):\n" " try:\n" - " ip.magic('run %s')\n" + " ip.magic(%r)\n" " except NameError as e:\n" " print(i)\n" - " break\n" % empty.fname) + " break\n" % ('run ' + empty.fname)) self.mktmp(src) _ip.magic('run %s' % self.fname) _ip.run_cell('ip == get_ipython()')