The Python Oracle

How do you generate dynamic (parameterized) unit tests in Python?

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game 2

--

Chapters
00:00 Question
00:42 Accepted answer (Score 275)
01:56 Answer 2 (Score 243)
03:31 Answer 3 (Score 89)
04:05 Answer 4 (Score 60)
05:24 Thank you

--

Full question
https://stackoverflow.com/questions/3289...

Accepted answer links:
[pytest's decorator]: https://docs.pytest.org/en/latest/parame...
[parameterized]: https://github.com/wolever/parameterized

Answer 2 links:
[unittest]: https://docs.python.org/3/library/unitte...
[26.4.7. Distinguishing test iterations using subtests]: https://docs.python.org/3/library/unitte...
[subTest]: https://docs.python.org/3/library/unitte...
[nose]: https://pypi.org/project/nose/
[nose]: https://nose.readthedocs.org/en/latest/
[supports this]: https://nose.readthedocs.org/en/latest/w...

Answer 4 links:
[the documentation]: https://docs.python.org/3/library/unitte...
[unittest2]: https://pypi.python.org/pypi/unittest2

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #unittesting #parameterizedunittest

#avk47