How can a user of a library run his own initialization code (setting debug levels of loggers for example) before running tests supplied with the library? Python\'s uni
Answer from similar question is more helpful here:
How to a run a specific code before & after each unit test in python
I used python setUpClass method https://docs.python.org/2/library/unittest.html#unittest.TestCase.setUpClass
setUpClass()
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():
@classmethod
def setUpClass(cls):
...
I run my tests like this:
python -m unittest discover -v