Test pasting sources with trailing question marks
(self)
| 208 | self.assertIn("foo", ip.user_ns) |
| 209 | |
| 210 | def test_paste_trailing_question(self): |
| 211 | "Test pasting sources with trailing question marks" |
| 212 | tm = ip.magics_manager.registry["TerminalMagics"] |
| 213 | s = """\ |
| 214 | def funcfoo(): |
| 215 | if True: #am i true? |
| 216 | return 'fooresult' |
| 217 | """ |
| 218 | ip.user_ns.pop("funcfoo", None) |
| 219 | self.paste(s) |
| 220 | self.assertEqual(ip.user_ns["funcfoo"](), "fooresult") |