From 14c0c073e441424a6ded31031fa2da8577142f37 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 21 Nov 2023 22:19:33 +0100 Subject: [PATCH] improve typing --- src/test_wrapper.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/test_wrapper.py b/src/test_wrapper.py index 8c60908..7731daf 100644 --- a/src/test_wrapper.py +++ b/src/test_wrapper.py @@ -1,5 +1,5 @@ from pathlib import Path -from typing import Optional, Protocol +from typing import Protocol from dotenv import dotenv_values from icecream import ic @@ -10,7 +10,7 @@ class TestRunner(Protocol): def __init__(self, dotenv_path: Path): ... - def run_tests(): + def run_tests(self): ... @@ -20,13 +20,11 @@ RUNNER_DICT: dict[str, type[TestRunner]] = {"wordpress": RunnerWordpress} class Wrapper: def __init__(self, dotenv_path: Path): assert dotenv_path.is_file() - config: dict[str, Optional[str]] = dotenv_values(dotenv_path) + config: dict[str, str] = dotenv_values(dotenv_path) runner = self.load_runner(config, dotenv_path) runner.run_tests() - def load_runner( - self, config: dict[str, Optional[str]], dotenv_path: Path - ) -> TestRunner: + def load_runner(self, config: dict[str, str], dotenv_path: Path) -> TestRunner: config_type = config["TYPE"] ic(config_type) RunnerClass = RUNNER_DICT[config_type]