Test that running a second file doesn't clobber the first, gh-3547
(self)
| 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): |