From 6622b8674b89cfe228b7ef3cb01ea1ecaf31dd19 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Thu, 1 Dec 2022 12:32:30 +0000 Subject: [PATCH] test.py: command subgroups: include group deps only once --- test/test.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/test.py b/test/test.py index 9bbb2c65..d8f1a735 100755 --- a/test/test.py +++ b/test/test.py @@ -368,7 +368,8 @@ class CmdGroupMgr(object): if sg_name and 'subgroup.' + sg_name not in cmd_group_in: die(1,f'{sg_name!r}: no such subgroup in test group {cls.__name__}') - def add_entries(key,add_deps=True): + def add_entries(key,add_deps=True,added_subgroups=[]): + if add_deps: for dep in cmd_group_in['subgroup.'+key]: for e in add_entries(dep): @@ -376,8 +377,10 @@ class CmdGroupMgr(object): assert isinstance(cls.cmd_subgroups[key][0],str), f'header for subgroup {key!r} missing!' - for e in cls.cmd_subgroups[key][1:]: - yield e + if not key in added_subgroups: + for e in cls.cmd_subgroups[key][1:]: + yield e + added_subgroups.append(key) def gen(): for name,data in cls.cmd_group_in: