3 ms·
In Python land this is called "parameterized tests": https://docs.pytest.org/en/7.1.x/example/parametrize.html https://docs.pytest.org/en/7.1.x/example/parametr
by boxed 3y ago
In Python land this is called "parameterized tests": https://docs.pytest.org/en/7.1.x/example/parametrize.html https://docs.pytest.org/en/7.1.x/example/parametrize.html
I think the author might want to look into mutation testing or property based testing to get to something closer to fully testing stuff.
- FrenchyJiby 3y agoYes, and going further, I think you'll enjoy the amazing lib Pytest-cases[1] which enables naming the parametrized tests, listing them not as decorators but as separate functions/classes. See the europython video intro: [2], or as slides[3] [1] https://smarie.github.io/python-pytest-cases/ https://smarie.github.io/python-pytest-cases/ [2]: https://www.youtube.com/watch?v=QTyfr2UNR98 https://www.youtube.com/watch?v=QTyfr2UNR98 [3]: https://ep2021.europython.eu/talks/649sqwq-powerful-tests-and-reproducible-benchmarks-with-pytest-cases/ https://ep2021.europython.eu/talks/649sqwq-powerful-tests-an...