(self)
| 423 | self.shell.run_code("assert ext_int == 2") |
| 424 | |
| 425 | def test_autoload3_import_Y_as_Z(self): |
| 426 | self.shell.magic_autoreload("3") |
| 427 | mod_code = """ |
| 428 | def func1(): pass |
| 429 | n = 1 |
| 430 | """ |
| 431 | mod_name, mod_fn = self.new_module(textwrap.dedent(mod_code)) |
| 432 | self.shell.run_code(f"from {mod_name} import n as foo") |
| 433 | self.shell.run_code("foo") |
| 434 | with self.assertRaises(NameError): |
| 435 | self.shell.run_code("func1()") |
| 436 | |
| 437 | new_code = """ |
| 438 | n = 100 |
| 439 | def func2(): pass |
| 440 | def func1(): pass |
| 441 | m = 5 |
| 442 | """ |
| 443 | self.write_file(mod_fn, textwrap.dedent(new_code)) |
| 444 | |
| 445 | self.shell.run_code("foo") |
| 446 | with self.assertRaises(NameError): |
| 447 | self.shell.run_code("n") |
| 448 | |
| 449 | def test_autoload3_import_Y_as_Z_overloading(self): |
| 450 | self.shell.magic_autoreload("3") |
nothing calls this directly
no test coverage detected