setup.py testsuite running

Is there currently any way to configure PyCharm's testrunner to use a testsuite defined in setup.py? I've tried messing around with it, but haven't been able to make it work, but maybe I have just missed some incantation.

4 comments

Hello Jeroen,

The PyCharm testrunner doesn't have any awareness of setup.py at the moment.

You're welcome to file a feature request at http://youtrack.jetbrains.net/

Is there currently any way to configure PyCharm's testrunner to use a

testsuite defined in setup.py? I've tried messing around with it, but

haven't been able to make it work, but maybe I have just missed some

incantation.

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

0
That bug says it is fixed, but I could not figure out how to use it. Please could some one explain how to use it.

Thanks.
0
I'm not sure what's up with that bug report but as far as I can tell in PyCharm 3.4.1 you can only get 'real' test reporting if you are using one of the supported test runners and configure it directly. Supported runners appear to be: attests, doctests, nose, py.test, and unitttest.

Some of these like unittest will let you select setup.py as the test script to run and it will discover tests that way.  If your test runner is one of those supported, that should work fine and report test results directly in PyCharm.  In my project I use nose and I just put the nose options from my setup.cfg into the PyCharm Run Configuration options (e.g. --all-modules --with-doctest --nocapture).

You can always create a normal Python run configuration and have it run setup.py with the test option, and that will force it to run with the designated test runner, but it may not report results back to PyCharm correctly.
0

Please sign in to leave a comment.