From c287dfd25cac1963c86493976f0794cde312f7cf Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Tue, 23 Mar 2021 22:15:58 +0000 Subject: [PATCH] tests: provide sane default for --topology-only Fixes: /usr/lib/python3.9/site-packages/_pytest/config/__init__.py:1463: in getoption val = getattr(self.option, name) E AttributeError: 'Namespace' object has no attribute 'topology_only' The above exception was the direct cause of the following exception: /usr/lib/python3.9/site-packages/pluggy/manager.py:127: in register hook._maybe_apply_history(hookimpl) /usr/lib/python3.9/site-packages/pluggy/hooks.py:333: in _maybe_apply_history res = self._hookexec(self, [method], kwargs) /usr/lib/python3.9/site-packages/pluggy/manager.py:93: in _hookexec return self._inner_hookexec(hook, methods, kwargs) /usr/lib/python3.9/site-packages/pluggy/manager.py:84: in self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall( tests/topotests/conftest.py:62: in pytest_configure if config.getoption("--topology-only"): /usr/lib/python3.9/site-packages/_pytest/config/__init__.py:1474: in getoption raise ValueError(f"no option named {name!r}") from e E ValueError: no option named 'topology_only' Signed-off-by: Quentin Young --- tests/topotests/conftest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/topotests/conftest.py b/tests/topotests/conftest.py index 7ad5d8c9ab..e00bebdaeb 100755 --- a/tests/topotests/conftest.py +++ b/tests/topotests/conftest.py @@ -61,6 +61,7 @@ def pytest_addoption(parser): parser.addoption( "--topology-only", action="store_true", + default=False, help="Only set up this topology, don't run tests", )