[openlp-dev] Moving to Nose 2
Raoul Snyman
raoul at snyman.info
Wed Jun 1 18:54:49 EDT 2016
Hi guys,
As of a few years ago, Nose[0] (our test runner) has been in
maintenance. I've been looking into moving to Nose2[1], and I've got a
branch[2] with changes to make our tests Nose2/unittest[3] compatible.
A few things to take note of:
- Files need to be named test_blah.py.
- Classes can be called BlahTest() and must inherit from
unittest.TestCase (not necessarily directly).
- Test methods MUST be named test_foo() (anything else will not be
picked up).
- Nose2 primarily loads from its configuration file. I've added one in
my branch.
- Due to the above point, running tests is now just a matter of
"nose2-3.5" in the root directory.
- If you do want to run functional or interface tests separately, you
need to use dot notation instead:
$ nose2-3.5 tests.functional
- Every test directory needs a __init__.py in it, as they are all
proper Python modules now.
Thankfully the changes that need to be made are backwards compatible, so
you can still run Nose 1 on the tests and you'll be covering everything.
There is one final test that I am still trying to find which Nose2 is
not running, but once that test is running and everything is passing
again, I'll propose my branch for merging.
[0] http://nose.readthedocs.io/en/latest/
[1] http://nose2.readthedocs.io/en/latest/
[2]
https://code.launchpad.net/~raoul-snyman/openlp/nose2-compatible-tests
[3] https://docs.python.org/3/library/unittest.html
--
Raoul Snyman
e: raoul at snyman.info
More information about the openlp-dev
mailing list