ID EN
Unittest

subTest

Python 3.11

Return a context manager which executes the enclosed code block as a subtest. msg and params are optional, arbitrary values which are displayed whenever a subtest fails, allowing you to identify them clearly.

Syntax

PYTHON
subTest(msg=None, **params)

See Also

Distinguishing test iterations using subtests