unittest2

How to run specific test in Nose2

How to run specific test in Nose2 Question: In previous version of Nose testing framework, there were several ways to specify only a subset of all tests: nosetests test.module nosetests another.test:TestCase.test_method nosetests a.test:TestCase nosetests /path/to/test/file.py:test_function http://nose.readthedocs.org/en/latest/usage.html#selecting-tests However, I can’t find any information about similar test selection in Nose2. There’s a mention in docs about different …

Total answers: 3

Why are unittest2 methods camelCase if names_with_underscores are preferred?

Why are unittest2 methods camelCase if names_with_underscores are preferred? Question: Here’s the section of PEP8 that describes how function names should be: Function names should be lowercase, with words separated by underscores as necessary to improve readability. mixedCase is allowed only in contexts where that’s already the prevailing style Why didn’t they change the function …

Total answers: 1

`python -m unittest discover` does not discover tests

`python -m unittest discover` does not discover tests Question: Python’s unittest discover does not find my tests! I have been using nose to discover my unit tests and it is working fine. From the top level of my project, if I run nosetests I get: Ran 31 tests in 0.390s Now that Python 2.7 unittest …

Total answers: 3