Skip to content

Commit 1d52839

Browse files
committed
Add a command line switch to ignore unknown dependencies.
1 parent 807c177 commit 1d52839

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pytest_dependency.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,15 @@ def pytest_addoption(parser):
108108
parser.addini("automark_dependency",
109109
"Add the dependency marker to all tests automatically",
110110
default=False)
111+
parser.addoption("--ignore-unknown-dependency",
112+
action="store_true", default=False,
113+
help="ignore dependencies whose outcome is not known")
111114

112115

113116
def pytest_configure(config):
114-
global _automark
117+
global _automark, _ignore_unknown
115118
_automark = _get_bool(config.getini("automark_dependency"))
119+
_ignore_unknown = config.getoption("--ignore-unknown-dependency")
116120

117121

118122
@pytest.hookimpl(tryfirst=True, hookwrapper=True)

0 commit comments

Comments
 (0)