add docstrings

This commit is contained in:
Daniel 2023-12-07 22:04:13 +01:00
parent b04e3a866c
commit c666e8de4c

View file

@ -63,6 +63,12 @@ def DIR(request) -> DirManager:
@pytest.fixture(scope="session")
def ENV_FILES(DIR: DirManager) -> dict[int, EnvFile]:
"""Dictionary of all EnvFile instances of the current test run
key: runner_index
value: EnvFile of the related env file
"""
out: dict[int, EnvFile] = dict()
for env_path in DIR.ENV_FILES.glob("*.env"):
config: dict[str, str] = dotenv_values(env_path) # type: ignore
@ -76,12 +82,14 @@ def ENV_FILES(DIR: DirManager) -> dict[int, EnvFile]:
@pytest.fixture(scope="session")
def dotenv_config(request, ENV_FILES: dict[int, EnvFile]) -> dict[str, str]:
"""Current env_config"""
runner_index = request.config.getoption("--runner_index")
return ENV_FILES[runner_index].config
@pytest.fixture(scope="session")
def URL(dotenv_config: dict[str, str]) -> BaseUrl:
"""BaseUrl object based on current DOMAIN"""
return BaseUrl(netloc=dotenv_config["DOMAIN"])