Skip to content

Commit

Permalink
Fix disabled in groups
Browse files Browse the repository at this point in the history
  • Loading branch information
atuonufure committed Jan 12, 2024
1 parent 6fc8c12 commit 88d3150
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,23 @@ def is_group(self, test):

return any(key.startswith("group") for key in test.keys())

def collect_tests(self, suites, subject):
def collect_tests(self, suites, subject, is_group_disabled=False):
for suite in suites:
current_group_disabled = is_group_disabled or suite.get("disable", False)
if self.is_group(suite):
name = next(iter(suite))
tests = suite[name]
for test in self.collect_tests(tests, subject):
for test in self.collect_tests(tests, subject, current_group_disabled):
yield test
else:
for test in self.collect_test(suite, subject):
for test in self.collect_test(suite, subject, current_group_disabled):
yield test

def collect_test(self, test, subject):
def collect_test(self, test, subject, is_group_disabled):
name = test["desc"] if "desc" in test else ""
is_disabled = "disable" in test and test["disable"]
is_disabled = (
is_group_disabled if is_group_disabled else "disable" in test and test["disable"]
)

if "expression" in test and not is_disabled:
if isinstance(test["expression"], list):
Expand Down

0 comments on commit 88d3150

Please sign in to comment.