MCPcopy Create free account
hub / github.com/ipython/ipython / test_run_i_after_reset

Method test_run_i_after_reset

IPython/core/tests/test_run.py:315–331  ·  view source on GitHub ↗

Check that %run -i still works after %reset (gh-693)

(self)

Source from the content-addressed store, hash-verified

313 tt.ipexec_validate(self.fname, out, err)
314
315 def test_run_i_after_reset(self):
316 """Check that %run -i still works after %reset (gh-693)"""
317 src = "yy = zz\n"
318 self.mktmp(src)
319 _ip.run_cell("zz = 23")
320 try:
321 _ip.magic('run -i %s' % self.fname)
322 nt.assert_equal(_ip.user_ns['yy'], 23)
323 finally:
324 _ip.magic('reset -f')
325
326 _ip.run_cell("zz = 23")
327 try:
328 _ip.magic('run -i %s' % self.fname)
329 nt.assert_equal(_ip.user_ns['yy'], 23)
330 finally:
331 _ip.magic('reset -f')
332
333 def test_unicode(self):
334 """Check that files in odd encodings are accepted."""

Callers

nothing calls this directly

Calls 3

mktmpMethod · 0.80
run_cellMethod · 0.45
magicMethod · 0.45

Tested by

no test coverage detected