summaryrefslogtreecommitdiffstats
path: root/qa/tasks/tests/conftest.py
blob: 7cc617a41321f50ea3b850e7e0dc7e8f9acb5ade (plain)
1
2
3
4
5
6
7
8
9
10
11
12
import glob


def pytest_addoption(parser):
    parser.addoption("--suite-dir", help="suite dir")

def pytest_generate_tests(metafunc):
    if "yaml_file" in metafunc.fixturenames:
        suite_dir = metafunc.config.getoption("--suite-dir")
        files = glob.glob(f"{suite_dir}/**/*.yaml", recursive=True)

        metafunc.parametrize("yaml_file", list(set(files)))