I believe he is looking for something like pytest’s parameterize: https://docs.pytest.org/en/6.2.x/example/parametrize.html
This is actually pretty basic functionality for writing DRY tests, a key missing feature. Frankly though, unittest is painfully unpythonic and hard to extend. I’ve given up. Just use pytest. -CHB On Mon, Sep 6, 2021 at 7:56 PM Steven D'Aprano <[email protected]> wrote: > Hi Leonardo, > > On Tue, Sep 07, 2021 at 02:31:26AM -0000, Leonardo Freua wrote: > > > When writing some unit tests with the standard Unittest library, I > > missed being able to create parameterized tests. > > Could you please explain what you mean by "parameterized tests", and how > you would use a decorator for it? What you mean by it may not be what > other people understand it to be. > > > > -- > Steve > _______________________________________________ > Python-ideas mailing list -- [email protected] > To unsubscribe send an email to [email protected] > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/[email protected]/message/CA7ZUSS7OXSM42IWZUXRKYNKVQG6MF2F/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython
_______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/54DSL6XLGAYMQ3DYVCE7HMQGG3HSK5NU/ Code of Conduct: http://python.org/psf/codeofconduct/
