From e5a0bc3ecd4d9c46ead3b8217584eaa916a3afa4 Mon Sep 17 00:00:00 2001 From: Benjamin Klimczak Date: Thu, 24 Aug 2023 16:38:47 +0100 Subject: MLIA-961 Update tox dependencies - Update version dependencies in the tox.ini - Fix linter issues Change-Id: I04c3a841ee2646a865dab037701d66c28792f2a4 Signed-off-by: Benjamin Klimczak --- tests_e2e/test_e2e.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tests_e2e') diff --git a/tests_e2e/test_e2e.py b/tests_e2e/test_e2e.py index c164901..2d8c375 100644 --- a/tests_e2e/test_e2e.py +++ b/tests_e2e/test_e2e.py @@ -44,13 +44,13 @@ class ExecutionConfiguration: def from_dict(cls, exec_info: dict) -> ExecutionConfiguration: """Create instance from the dictionary.""" if not (command := exec_info.get("command")): - raise Exception("Command is not defined") + raise ValueError("Command is not defined.") if command not in VALID_COMMANDS: - raise Exception(f"Unknown command {command}") + raise ValueError(f"Command {command} is unknown.") if not (params := exec_info.get("parameters")): - raise Exception(f"Command {command} should have parameters") + raise ValueError(f"Command {command} should have parameters.") assert isinstance(params, dict), "Parameters should be a dictionary" assert all( @@ -101,13 +101,13 @@ def launch_and_wait( if print_output: print(output) else: - raise Exception("Unable to get process output") + raise RuntimeError("Unable to get process output. stdout is unavailable.") # Wait for the process to terminate process.wait() if (exit_code := process.poll()) != 0: - raise Exception(f"Command failed with exit_code {exit_code}") + raise RuntimeError(f"Command failed with exit_code {exit_code}.") def run_command( @@ -142,11 +142,11 @@ def get_config_file() -> Path: """Get path to the configuration file.""" env_var_name = "MLIA_E2E_CONFIG_FILE" if not (config_file_env_var := os.environ.get(env_var_name)): - raise Exception(f"Config file env variable ({env_var_name}) is not set") + raise ValueError(f"Config file env variable ({env_var_name}) is not set.") config_file = Path(config_file_env_var) if not config_file.is_file(): - raise Exception(f"Invalid config file {config_file_env_var}") + raise FileNotFoundError(f"Invalid config file {config_file_env_var}.") return config_file -- cgit v1.2.1