You can try using pytest to run unittests. If this works (a lot of unittest-based test suites work), you can create a small module, for example "mymod.py", which defines the pytest configuration hook:
# content of mymod.py def pytest_configure(): import logging logging.getLogger().setLevel(logging.WARN)
If you now do py.test as follows:
$ py.test -p mymmod --pyargs mylib
The "mylib" package will then search for tests and the logging level will be changed before running them. The -p option tells the plugin to load, and -pyargs tells pytest to try to import the arguments first, rather than treat them as directory or file names (by default).
For more information: http://pytest.org and http://pytest.org/latest/unittest.html
NTN, Holger
hpk42 source share