Run the method only once at the beginning before running any tests in PyUnit

Im using PyUnit to write unit tests for my code. The installation method is called every time before running any test. Is there a way that I can define a method that will only run once at the beginning before running any tests?

Please help. Thank you.

+6
source share
2 answers

You can use setUpClass or setUpModule in Python 2.7 and 3.2.

+4
source

How about using a test class constructor?

0
source

Source: https://habr.com/ru/post/902186/


All Articles