| 712 | nt.assert_equal(_ip.user_ns['x'], '\t') |
| 713 | |
| 714 | def test_extension(): |
| 715 | # Debugging information for failures of this test |
| 716 | print('sys.path:') |
| 717 | for p in sys.path: |
| 718 | print(' ', p) |
| 719 | print('CWD', os.getcwd()) |
| 720 | |
| 721 | nt.assert_raises(ImportError, _ip.magic, "load_ext daft_extension") |
| 722 | daft_path = os.path.join(os.path.dirname(__file__), "daft_extension") |
| 723 | sys.path.insert(0, daft_path) |
| 724 | try: |
| 725 | _ip.user_ns.pop('arq', None) |
| 726 | invalidate_caches() # Clear import caches |
| 727 | _ip.magic("load_ext daft_extension") |
| 728 | nt.assert_equal(_ip.user_ns['arq'], 185) |
| 729 | _ip.magic("unload_ext daft_extension") |
| 730 | assert 'arq' not in _ip.user_ns |
| 731 | finally: |
| 732 | sys.path.remove(daft_path) |
| 733 | |
| 734 | |
| 735 | def test_notebook_export_json(): |