pythonpycharmnose2

How to configure pycharm to use nose2 instead of nose


According to the http://nose.readthedocs.io/en/latest all tests

... should consider using Nose2, py.test, or just plain unittest/unittest2.

However, I can't seem to make Pycharm use it instead of nose. Is there some setting I can configure so that it uses nose2 to do its testing instead of nose?

EDIT: Nose2 is included in my Project Interpreter's list of packages enter image description here

However, I can't run any tests (which is why I asked this question) enter image description here


Solution

  • I went to run -> run... -> edit configurations and then setup a new python (not python test) config that ran module name: nose2 and my test package name for the parameters. That is parameters: tests.test_my_fun_test

    Make sure that the python interpreter is set to the one you intended to use. (Like the project default) and that that interpreter has nose2 installed.

    Also, in the pycharm editor window when looking at the code for a unittest class, right clicking on a test class name brings up a menu with "run unittests for..." which seems to do the correct thing. ( I have no idea if it is running nose2 or not but it works nicely)