How do you run nosetest from pycharm?

Nick Sonneveld picture Nick Sonneveld · Oct 14, 2010 · Viewed 19.5k times · Source

How do you execute nosetest from pycharm to run all unit tests?

I know that pycharm supports python's unittest and py.test and that they will properly support nosetests in pycharm 1.1 but I was wondering if there was a work around.

Answer

Danny Staple picture Danny Staple · Nov 13, 2012

In the current version of Pycharm (2.6) there should be a context menu "run Nosetests in ..." on a test file. If this is missing, go to file->settings->Project Settings->python integrated tools and ensure the Default Test Runner is Nosetests. You do of course need to have Nosetests installed - pycharm will offer this if you do not.

This does have a limitation. If the file in question does not have a class derived from unittest.TestCase it will not automatically show this. If you are using nose.tools or simple assertions it will not automatically offer this. This is probably a bug.