Exemple #1
0
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")
Exemple #2
0
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')
Exemple #3
0
 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)
Exemple #4
0
 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)