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

Create test cases from generators #8

Closed
rileyshahar opened this issue Sep 28, 2021 · 0 comments · Fixed by #36
Closed

Create test cases from generators #8

rileyshahar opened this issue Sep 28, 2021 · 0 comments · Fixed by #36

Comments

@rileyshahar
Copy link
Owner

It would be very convenient to create many test cases simultaneously from iterators. Here's an idea for an API:

test_cases(*args, aga_output = None, aga_product = True, aga_squash = False, **kwargs)

The user provides an iterator for each of the *args.

  • If aga_product is true, we create one set of test inputs for each element of the Cartesian product of each iterator. Otherwise, we iterate through each iterator simultaneously, creating one set of test inputs for each iteration, and stopping (or erroring?) if their lengths differ.
  • If aga_squash is False, we create one test case for each set of test inputs; otherwise, we put them all in a single test case, and have that test case loop through each set of inputs.
  • aga_output (and any other aga_-prefixed kwargs) is passed directly to test_case. It should also be a generator and probably only makes sense if aga_product is False, or maybe we just don't want to allow parameterized golden tests like this.
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

Successfully merging a pull request may close this issue.

1 participant