Show More
@@ -171,6 +171,7 b' class InteractiveShellTestCase(unittest.TestCase):' | |||||
171 | expected = [ py3compat.unicode_to_str(e, enc) for e in expected ] |
|
171 | expected = [ py3compat.unicode_to_str(e, enc) for e in expected ] | |
172 | self.assertEqual(hist, expected) |
|
172 | self.assertEqual(hist, expected) | |
173 |
|
173 | |||
|
174 | class TerminalMagicsTestCase(unittest.TestCase): | |||
174 | def test_paste_magics_message(self): |
|
175 | def test_paste_magics_message(self): | |
175 | """Test that an IndentationError while using paste magics doesn't |
|
176 | """Test that an IndentationError while using paste magics doesn't | |
176 | trigger a message about paste magics and also the opposite.""" |
|
177 | trigger a message about paste magics and also the opposite.""" | |
@@ -187,3 +188,16 b' class InteractiveShellTestCase(unittest.TestCase):' | |||||
187 | with tt.AssertNotPrints("If you want to paste code into IPython, try the " |
|
188 | with tt.AssertNotPrints("If you want to paste code into IPython, try the " | |
188 | "%paste and %cpaste magic functions."): |
|
189 | "%paste and %cpaste magic functions."): | |
189 | tm.store_or_execute(s, name=None) |
|
190 | tm.store_or_execute(s, name=None) | |
|
191 | ||||
|
192 | def test_paste_magics_blankline(self): | |||
|
193 | """Test that code with a blank line doesn't get split (gh-3246).""" | |||
|
194 | ip = get_ipython() | |||
|
195 | s = ('def pasted_func(a):\n' | |||
|
196 | ' b = a+1\n' | |||
|
197 | '\n' | |||
|
198 | ' return b') | |||
|
199 | ||||
|
200 | tm = ip.magics_manager.registry['TerminalMagics'] | |||
|
201 | tm.store_or_execute(s, name=None) | |||
|
202 | ||||
|
203 | self.assertEqual(ip.user_ns['pasted_func'](54), 55) |
General Comments 0
You need to be logged in to leave comments.
Login now