From 5c8b51531d88f22c26805ef9fd89763de32052a5 2011-04-10 10:43:53 From: Thomas Kluyver Date: 2011-04-10 10:43:53 Subject: [PATCH] Test for magic names in multiline strings. --- diff --git a/IPython/core/tests/test_interactiveshell.py b/IPython/core/tests/test_interactiveshell.py index 6c8fb79..560f2a4 100644 --- a/IPython/core/tests/test_interactiveshell.py +++ b/IPython/core/tests/test_interactiveshell.py @@ -86,3 +86,8 @@ class InteractiveShellTestCase(unittest.TestCase): newlen = len(ip.user_ns['In']) self.assertEquals(oldlen+1, newlen) self.assertEquals(ip.user_ns['In'][-1],'1;') + + def test_magic_names_in_string(self): + ip = get_ipython() + ip.run_cell('"""\n%exit\n"""') + self.assertEquals(ip.user_ns['In'][-1], '\n%exit\n')