Permalink
Browse files

Add failing test for gh-3547

  • Loading branch information...
1 parent b11b916 commit 601235a209ab9dab7c721c8648f2a9c642dad11c @takluyver committed Jul 5, 2013
Showing with 14 additions and 0 deletions.
  1. +14 −0 IPython/core/tests/test_run.py
@@ -263,6 +263,20 @@ class secondtmp(tt.TempFileMixin): pass
_ip.magic('run %s' % self.fname)
_ip.run_cell('ip == get_ipython()')
nt.assert_equal(_ip.user_ns['i'], 5)
+
+ def test_run_second(self):
+ """Test that running a second file doesn't clobber the first, gh-3547
+ """
+ self.mktmp("avar = 1\n"
+ "def afunc():\n"
+ " return avar\n")
+
+ empty = tt.TempFileMixin()
+ empty.mktmp("")
+
+ _ip.magic('run %s' % self.fname)
+ _ip.magic('run %s' % empty.fname)
+ nt.assert_equal(_ip.user_ns['afunc'](), 1)
@dec.skip_win32
def test_tclass(self):

0 comments on commit 601235a

Please sign in to comment.