Module setup() and teardown() functions are found by nosetests [1] but unittests expects setUpModule() and tearDownModule() [2]. The latter function names are also found by nosetests, so using those function names enables the test module to be run with either nosetests or unittest. Although the tox test envs and .unittests script use nosetests, this change allows the convenience of using unittest, for example when it is the default test runner in a development environment such as PyCharm. This change also makes it unnecessary to explicitly call the setup() and teardown() functions when executing the module directly. [1] http://nose.readthedocs.io/en/latest/writing_tests.html#test-modules [2] https://docs.python.org/2/library/unittest.html#setupmodule-and-teardownmodule Change-Id: Ib2e5470a339af1f937b25d643b64356e8848ed36
1.8 KiB
1.8 KiB