improve typing
This commit is contained in:
parent
1faaf4700a
commit
c7d0ba9273
1 changed files with 5 additions and 3 deletions
|
|
@ -1,5 +1,5 @@
|
|||
from pathlib import Path
|
||||
from typing import Protocol
|
||||
from typing import Optional, Protocol
|
||||
|
||||
from dotenv import dotenv_values
|
||||
from icecream import ic
|
||||
|
|
@ -20,11 +20,13 @@ RUNNER_DICT: dict[str, type[TestRunner]] = {"wordpress": RunnerWordpress}
|
|||
class Wrapper:
|
||||
def __init__(self, dotenv_path: Path):
|
||||
assert dotenv_path.is_file()
|
||||
config = dotenv_values(dotenv_path)
|
||||
config: dict[str, Optional[str]] = dotenv_values(dotenv_path)
|
||||
runner = self.load_runner(config, dotenv_path)
|
||||
runner.run_tests()
|
||||
|
||||
def load_runner(self, config, dotenv_path):
|
||||
def load_runner(
|
||||
self, config: dict[str, Optional[str]], dotenv_path: Path
|
||||
) -> TestRunner:
|
||||
config_type = config["TYPE"]
|
||||
ic(config_type)
|
||||
RunnerClass = RUNNER_DICT[config_type]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue