In other BDD frameworks (e.g., mocha), one is able wrap the declaration of individual tests inside a loop so that each pass through the loop adds another set of tests. One example I've used is to walk through a whole set of classes ensuring they each obey some invariant of their common parent class. Another example is a library I've written which can have multiple implementations, but which should offer the same interface no matter what implementation it's using.
for Subclass in [SubclassAlpha, SubclassBravo, SubclassCharlie]:
with description(f"using {subclass.__name__}:"):
# add tests which create an instance of Subclass and test it
In other BDD frameworks (e.g., mocha), one is able wrap the declaration of individual tests inside a loop so that each pass through the loop adds another set of tests. One example I've used is to walk through a whole set of classes ensuring they each obey some invariant of their common parent class. Another example is a library I've written which can have multiple implementations, but which should offer the same interface no matter what implementation it's using.