@pytest.fixture(scope="session")
def confborg(request):
    print("#FIXTURE: confborg")

    def run_only_at_session_end():
        print("\n ********** End of test session **********")
    request.addfinalizer(run_only_at_session_end)

    print("********** Test session init **********")

    if pytest.config.getoption('confpath') is not None:
        print("Launch test with conf:", pytest.config.getoption('confpath', default=None))
        conf_path = pytest.config.getoption('confpath')
        # previously returns a list, get the string
        if len(pytest.config.getoption('confpath')) > 0:
            conf_path = pytest.config.getoption('confpath')[0]

    if os.path.exists(conf_path):
        with open(conf_path, 'rt') as f:
            conf = json.load(f)

        # add data path which is calculated at run time
        conf['data_path'] = os.path.dirname(os.path.dirname(conf_path))
        conf['data_path'] = os.path.join(conf['data_path'], 'data')
        res = TestBorg(conf)
        logger.info("TestBorg initialized")
    return res
- allow confborg to be a valid test parameter,
dataset/ETHPy150Open GustavePate/lycheesync/conftest.py/confborg