summaryrefslogtreecommitdiff
path: root/tests/topotests/munet/compat.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/topotests/munet/compat.py')
-rw-r--r--tests/topotests/munet/compat.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/topotests/munet/compat.py b/tests/topotests/munet/compat.py
index bf9092e53a..e82a7d5b77 100644
--- a/tests/topotests/munet/compat.py
+++ b/tests/topotests/munet/compat.py
@@ -11,8 +11,18 @@
class PytestConfig:
"""Pytest config duck-type-compatible object using argprase args."""
+ class Namespace:
+ """A namespace defined by a dictionary of values."""
+
+ def __init__(self, args):
+ self.args = args
+
+ def __getattr__(self, attr):
+ return self.args[attr] if attr in self.args else None
+
def __init__(self, args):
self.args = vars(args)
+ self.option = PytestConfig.Namespace(self.args)
def getoption(self, name, default=None, skip=False):
assert not skip