ID EN
Unittest

setUpClass

Python 3.11

A class method called before tests in an individual class are run. setUpClass is called with the class as the only argument and must be decorated as a classmethod():

Syntax

PYTHON
setUpClass()

Examples

Example 1
PYTHON
@classmethod
def setUpClass(cls):
    ...

See Also

classmethod() Class and Module Fixtures