February 2022
Intermediate to advanced
274 pages
6h 28m
English
So far we’ve looked at tests with one parameter variation per test or fixture. However, you can use more than one. Let’s say you have a list of summaries, owners, and states and we want to test the cards_db.add_card() method against all combinations of summary, owner, state:
| | summaries = ["short", "a bit longer"] |
| | owners = ["First", "First M. Last"] |
| | states = ["todo", "in prog", "done"] |
You can use multiple parameters and pass in a tuple or list of values to line up with these parameters. In the example that follows, we’re using a comma-separated list of parameter names: "summary, owner, state". You can also use a list of strings, or ["summary", "owner", "state"]. The former involves ...
Read now
Unlock full access