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

Method test_run_second

IPython/core/tests/test_run.py:279–291  ·  view source on GitHub ↗

Test that running a second file doesn't clobber the first, gh-3547

(self)

Source from the content-addressed store, hash-verified

277 nt.assert_equal(_ip.user_ns['i'], 4)
278
279 def test_run_second(self):
280 """Test that running a second file doesn't clobber the first, gh-3547
281 """
282 self.mktmp("avar = 1\n"
283 "def afunc():\n"
284 " return avar\n")
285
286 with tt.TempFileMixin() as empty:
287 empty.mktmp("")
288
289 _ip.magic('run %s' % self.fname)
290 _ip.magic('run %s' % empty.fname)
291 nt.assert_equal(_ip.user_ns['afunc'](), 1)
292
293 @dec.skip_win32
294 def test_tclass(self):

Callers

nothing calls this directly

Calls 2

mktmpMethod · 0.80
magicMethod · 0.45

Tested by

no test coverage detected