Signed-off-by: Sebastian Wagner <sewagner@redhat.com>
--- /dev/null
+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)))
--- /dev/null
+import yaml
+
+
+def test_load_yaml(yaml_file):
+ yaml.safe_load(open(yaml_file))
httplib2
commands =
pytest --assert=plain test_import.py
- pytest tasks/tests
+ pytest tasks/tests --suite-dir {toxinidir}/suites {posargs}
[testenv:deadsymlinks]
basepython = python3