From d0a80859f630866461e8a888b3f8fe008c8158ba Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Fri, 11 Sep 2020 14:27:26 +0200 Subject: Added suite group and suite bonus, Added signal (not tested) --- src/suite/suite.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/suite/suite.py') diff --git a/src/suite/suite.py b/src/suite/suite.py index fee4aa9..d796cf7 100644 --- a/src/suite/suite.py +++ b/src/suite/suite.py @@ -6,12 +6,11 @@ # By: charles +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2020/07/15 18:24:29 by charles #+# #+# # -# Updated: 2020/09/11 12:27:47 by charles ### ########.fr # +# Updated: 2020/09/11 14:18:01 by charles ### ########.fr # # # # ############################################################################ # import config -from test import Test class Suite: @@ -26,7 +25,12 @@ class Suite: def setup(cls, asked_names: [str]): if len(asked_names) == 0: asked_names = [s.name for s in cls.available] - cls.available = [s for s in cls.available if s.name in asked_names] + if not config.BONUS: + cls.available = [s for s in cls.available if not s.bonus] + cls.available = list(set( + [s for s in cls.available if s.name in asked_names] + + [s for s in cls.available if any([g for g in s.groups if g in asked_names])] + )) for s in cls.available: s.generate() @@ -34,8 +38,10 @@ class Suite: def available_names(cls) -> [str]: return [s.name for s in cls.available] - def __init__(self, name: str): + def __init__(self, name: str, groups: [str], bonus: bool = False): self.name = name + self.groups = groups + self.bonus = bonus self.generator_func = None self.tests = [] -- cgit