Skip to content

Commit

Permalink
tests: fix undercounting of suites
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pks-t committed Jul 18, 2019
1 parent 29fe79e commit 9210997
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/generate.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def disable(self, excluded):
module.modified = True

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):
return sum(len(module.callbacks) for module in self.modules.values())
Expand Down

0 comments on commit 9210997

Please sign in to comment.