def pytest_collection_modifyitems(config, items):
    if config.getoption('--runelasticsearch'):
        skip_unit_tests = pytest.mark.skip(reason='not running when --runelasticsearch option is used to run')
        for item in items:
            if ('elasticsearch' not in item.keywords):
                item.add_marker(skip_unit_tests)
    else:
        skip_elasticsearch = pytest.mark.skip(reason='need --runelasticsearch option to run')
        for item in items:
            if ('elasticsearch' in item.keywords):
                item.add_marker(skip_elasticsearch)
def pytest_collection_modifyitems(config, items):
    if config.getoption('--runelasticsearch'):
        skip_unit_tests = pytest.mark.skip(reason='not running when --runelasticsearch option is used to run')
        for item in items:
            if ('elasticsearch' not in item.keywords):
                item.add_marker(skip_unit_tests)
    else:
        skip_elasticsearch = pytest.mark.skip(reason='need --runelasticsearch option to run')
        for item in items:
            if ('elasticsearch' in item.keywords):
                item.add_marker(skip_elasticsearch)