Running a method just once at the beginning before any tests are run in PyUnit
-
07-03-2021 - |
Вопрос
Im using PyUnit to write unit tests for my code. The setup method is called everytime before any test is run. Is there a way i can define a method that will be run just once at the beginning before any tests are run ?
Please Help Thank You
Решение
You can use setUpClass or setUpModule in Python 2.7 and 3.2.
Другие советы
How about using the constructor of your test class?
Не связан с StackOverflow