diff --git a/exasol_integration_test_docker_environment/doctor.py b/exasol_integration_test_docker_environment/doctor.py index 5640a8006..4fe8bc21b 100644 --- a/exasol_integration_test_docker_environment/doctor.py +++ b/exasol_integration_test_docker_environment/doctor.py @@ -3,7 +3,8 @@ package and also provide help to find potential fixes. """ import sys -from typing import Iterable +from collections.abc import Callable +from typing import Iterable, List, Tuple from exasol import error from enum import Enum @@ -78,11 +79,13 @@ def health_checkup() -> Iterable[error.ExaError]: return an iterator of error codes specifying which problems have been identified. """ - examinations = [ + check_function = Callable[[],bool] + diagnosis_function = Callable[[],Iterable[error.ExaError]] + examinations : List[Tuple[check_function, diagnosis_function]] = [ (is_docker_daemon_available, diagnose_docker_daemon_not_available), - (is_supported_platform, lambda: Error.TargetPlatformNotSupported), + (is_supported_platform, lambda: [Error.TargetPlatformNotSupported]), ] for is_fine, diagnosis in examinations: if not is_fine(): - for error_code in diagnosis(): # type: ignore + for error_code in diagnosis(): yield error_code diff --git a/exasol_integration_test_docker_environment/lib/api/common.py b/exasol_integration_test_docker_environment/lib/api/common.py index bff85d6f7..6d93671da 100644 --- a/exasol_integration_test_docker_environment/lib/api/common.py +++ b/exasol_integration_test_docker_environment/lib/api/common.py @@ -104,8 +104,9 @@ def import_build_steps(flavor_path: Tuple[str, ...]): path_to_build_steps = Path(path).joinpath("flavor_base/build_steps.py") module_name_for_build_steps = extract_modulename_for_build_steps(path) spec = importlib.util.spec_from_file_location(module_name_for_build_steps, path_to_build_steps) - module = importlib.util.module_from_spec(spec) # type: ignore - spec.loader.exec_module(module) # type: ignore + assert spec and spec.loader + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) def generate_root_task(task_class, *args, **kwargs) -> DependencyLoggerBaseTask: @@ -178,7 +179,7 @@ def _configure_logging( use_job_specific_log_file: bool) -> Iterator[Dict[str, str]]: with get_luigi_log_config(log_file_target=log_file_path, log_level=log_level, - use_job_specific_log_file=use_job_specific_log_file) as luigi_config: # type: Path + use_job_specific_log_file=use_job_specific_log_file) as luigi_config: no_configure_logging, run_kwargs = _configure_logging_parameter( log_level=log_level, luigi_config=luigi_config,