def test_install_flask(): module = "flask" try: try_import(module, expect_failure=True) installer.install_package("flask") try_import(module, expect_failure=False) finally: installer.uninstall_package("flask")
def test_install_flask(): module = 'flask' try: try_import(module, expect_failure=True) installer.install_package('flask') try_import(module, expect_failure=False) finally: installer.uninstall_package('flask')
def find_package(self, name): try: return find_module_under(name) except ImportError: # Package not found: installed it try: install_package(name) except FailedToInstall: raise ImportError return find_module_under(name)