aboutsummaryrefslogtreecommitdiffstats
path: root/hdv/redfish/conftest.py
diff options
context:
space:
mode:
Diffstat (limited to 'hdv/redfish/conftest.py')
-rw-r--r--hdv/redfish/conftest.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/hdv/redfish/conftest.py b/hdv/redfish/conftest.py
new file mode 100644
index 0000000..9bc7bcb
--- /dev/null
+++ b/hdv/redfish/conftest.py
@@ -0,0 +1,19 @@
+import pytest
+from hdv_redfish import read_yaml
+
+def pytest_addoption(parser):
+ parser.addoption(
+ "--cases", action="store", default="./conf/cases.yaml", help="case yaml file"
+ )
+ parser.addoption(
+ "--config", action="store", default="./conf/config.yaml", help="given global config.yaml file"
+ )
+
+@pytest.fixture(scope = 'session')
+def conf_file(request):
+ return request.config.getoption("--config")
+
+def pytest_generate_tests(metafunc):
+ if "case" in metafunc.fixturenames:
+ cases_file = metafunc.config.getoption("--cases")
+ metafunc.parametrize("case", read_yaml(cases_file)) \ No newline at end of file