-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
21 lines (16 loc) · 717 Bytes
/
conftest.py
File metadata and controls
21 lines (16 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""Configuration functioons for pytest
Enables --sdd_file='...' argument and --sdd_metadata='....' on pytest command line
"""
def pytest_addoption(parser):
parser.addoption("--sdd_file", action="append", default=[])
parser.addoption("--sdd_metadata", action="append", default=[])
def pytest_generate_tests(metafunc):
custom_arguments = ["sdd_file", "sdd_metadata"]
for arg in custom_arguments:
if arg in metafunc.fixturenames:
if metafunc.config.getoption(arg):
metafunc.parametrize(
arg, metafunc.config.getoption(arg), scope="session"
)
else:
metafunc.parametrize(arg, [None], scope="session")