]> git.proxmox.com Git - mirror_frr.git/commitdiff
tests: provide sane default for --topology-only
authorQuentin Young <qlyoung@nvidia.com>
Tue, 23 Mar 2021 22:15:58 +0000 (22:15 +0000)
committerQuentin Young <qlyoung@nvidia.com>
Wed, 7 Apr 2021 17:31:27 +0000 (13:31 -0400)
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 <lambda>
    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 <qlyoung@nvidia.com>
tests/topotests/conftest.py

index 7ad5d8c9ab7b82523fc2b1f25ced17aeede4d2b5..e00bebdaebf80493bdccec9e6614b42a83ea740d 100755 (executable)
@@ -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",
     )