How to configure pycharm to use nose2 instead of nose
Asked Answered
T

2

7

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

Transcript answered 21/2, 2018 at 18:4 Comment(0)
P
2

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)

Protector answered 21/5, 2018 at 13:47 Comment(0)
C
-2

Did you try to uninstal nose before installing nose2?

You can run:

pip uninstall nose

Then try and install Nose2 in the project directory of your Pycharm project

pip install nose2

You can also go to

File > Settings > Project: [Name] > Project Interpreter

In your Pycharm project to install and uninstall packages for your project.

enter image description hereenter image description here

Camail answered 21/2, 2018 at 18:32 Comment(2)
I've updated my original post to include more information. I do have nose2 installed, but I can't use it to run any tests in Pycharm.Transcript
Oh I understand your question better now - I'll see if I can figure it outCamail

© 2022 - 2024 — McMap. All rights reserved.