On Tue, 2021-09-07 at 02:31 +0000, Leonardo Freua wrote:
> When writing some unit tests with the standard Unittest library, I missed 
> being
> able to create parameterized tests. This functionality exists in PyTest
> (https://docs.pytest.org/en/6.2.x/parametrize.html) and there is also a 
> library
> called *parameterized*(https://github.com/wolever/parameterized) which aims to
> add this functionality.
> 
> However, I think it would be beneficial to have a decorator in Python's 
> standard
> Unittest library.
> 
> Note: If this functionality exists natively in Python, please put some example
> or documentation link below.
> 
> Thanks in advance.

Hi Leonardo,

Please check out subtests, they allow you to achieve what you are looking for :)
https://docs.python.org/3/library/unittest.html#distinguishing-test-iterations-using-subtests

Cheers,
Filipe Laíns

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
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/AJSJKC4PD4KWS53IJLTWORHC7QZGJXDG/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to