(module_name, file_path)
| 365 | |
| 366 | |
| 367 | def import_from_path(module_name, file_path): |
| 368 | try: |
| 369 | spec = importlib.util.spec_from_file_location(module_name, file_path) |
| 370 | module = importlib.util.module_from_spec(spec) |
| 371 | sys.modules[module_name] = module |
| 372 | spec.loader.exec_module(module) |
| 373 | return module |
| 374 | except Exception as e: |
| 375 | raise ImportModuleException(f"failed to load python module: {e}") |
| 376 | |
| 377 | |
| 378 | def create_database_connection(): |
no test coverage detected