move conftest to root level

This commit is contained in:
Daniel 2023-11-21 21:58:53 +01:00
parent 534eb229c9
commit fa4c840374

20
src/conftest.py Normal file
View file

@ -0,0 +1,20 @@
from pathlib import Path
import pytest
from dotenv import dotenv_values
def pytest_addoption(parser):
parser.addoption(
"--env_file_path",
action="store",
)
@pytest.fixture
def config(request):
dotenv_path = request.config.getoption("--env_file_path")
dotenv_path = Path(dotenv_path)
assert dotenv_path.is_file()
config = dotenv_values(dotenv_path)
return config