Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameterized specs #106

Open
andrewminer opened this issue Mar 16, 2018 · 1 comment
Open

Parameterized specs #106

andrewminer opened this issue Mar 16, 2018 · 1 comment

Comments

@andrewminer
Copy link

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
@nestorsalceda
Copy link
Owner

It's a good feature to think about.

Let me consider some implementation details.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants