behave-framework/conftest.py

20 lines
383 B
Python
Raw Normal View History

2020-09-16 16:02:39 +00:00
import configparser
import pytest
2020-09-18 09:46:11 +00:00
2020-09-16 16:02:39 +00:00
config = configparser.ConfigParser()
@pytest.fixture(scope="session", autouse=True)
def headless():
return _str_to_bool(_read_config_section("fixtures.ini", "dev")["headless"])
2020-09-16 16:02:39 +00:00
def _read_config_section(source, section):
config.read(source)
return config[section]
def _str_to_bool(s):
return s.lower() in ['true', '1', 'yes']