def test_tryimport(self): """ Test that try-import don't crash on trailing dot, and import modules before """ from IPython.core.completerlib import try_import assert try_import("IPython.")
def test_module_without_init(): """ Test module without __init__.py. https://github.com/ipython/ipython/issues/11226 """ fake_module_name = "foo" with TemporaryDirectory() as tmpdir: sys.path.insert(0, tmpdir) try: os.makedirs(os.path.join(tmpdir, fake_module_name)) s = try_import(mod=fake_module_name) assert s == [] finally: sys.path.remove(tmpdir)
def test_tryimport(): """ Test that try-import don't crash on trailing dot, and import modules before """ from IPython.core.completerlib import try_import assert(try_import("IPython."))