What is Parametrization?
Parametrization lets you run the same test logic with different inputs. Instead of writing repetitive tests, write one test that runs multiple times with different parameter sets.Basic Parametrization
merit_greeting[World-Hello, World!]merit_greeting[Alice-Hello, Alice!]merit_greeting[Bob-Hello, Bob!]
Custom Test IDs
Make test names more readable with custom IDs:Multiple Parameters
Parametrize with many parameters:Async Tests
Parametrization works with async tests:Combining with Resources
Parametrized tests can use resources:Parametrize vs iter_cases
When to use@merit.parametrize:
- ✅ Simple, flat parameter lists
- ✅ Few parameters (2-4)
- ✅ Quick test variations
@merit.iter_cases:
- ✅ Complex, structured test data
- ✅ Many parameters or nested data
- ✅ Need metadata, tags, or type safety
- ✅ Reusable test cases across multiple tests