behave-framework/conftest.py
Greg Gauthier 4e3c267656
Some checks failed
Execute / build (3.12) (push) Failing after 24s
Pylint / build (3.12) (push) Successful in 10s
run the tests
2024-07-23 15:48:03 +01:00

25 lines
521 B
Python
Executable File

import configparser
import os
import pytest
CWD = os.path.dirname(os.path.realpath(__file__))
config = configparser.ConfigParser()
@pytest.fixture(scope="session", autouse=True)
def headless():
config_file = os.path.join(CWD, "fixtures.ini")
dev_config = _read_config_section(config_file, 'dev')
return _str_to_bool(dev_config["headless"])
def _read_config_section(source, section):
config.read(source)
return config[section]
def _str_to_bool(s):
return s.lower() in ['true', '1', 'yes']