Commit 92109976 by Patrick Steinhardt

tests: fix undercounting of suites

With the introduction of data variants for suites, we started
undercounting the number of suites as we didn't account for those that
were executed twice. This was then adjusted to count the number of
initializers instead, but this fails to account for suites without any
initializers at all.

Fix the suite count by counting either the number of initializers or, if
there is no initializer, count it as a single suite, only.
parent 29fe79e6
...@@ -210,7 +210,7 @@ class TestSuite(object): ...@@ -210,7 +210,7 @@ class TestSuite(object):
module.modified = True module.modified = True
def suite_count(self): def suite_count(self):
return sum(len(module.initializers) for module in self.modules.values()) return sum(max(1, len(m.initializers)) for m in self.modules.values())
def callback_count(self): def callback_count(self):
return sum(len(module.callbacks) for module in self.modules.values()) return sum(len(module.callbacks) for module in self.modules.values())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment