LateCoder
LateCoder

Reputation: 2283

Debugging nosetest test in Pycharm doesn't show output

I'm trying to debug a test using nosetests in PyCharm. I need to stop at a breakpoint and do some interactive debugging using the PyCharm debug console. However, whenever I type anything at the debug console prompt, nothing is printed; I just get a new prompt. The debug console works perfectly with pytest, but I need to use nosetests for this particular test. How can I get the console to work correctly?

Upvotes: 16

Views: 3232

Answers (3)

Sachin
Sachin

Reputation: 18767

Under the Tools menu, select Edit Configurations. In the dialog, expand Python tests and select the nosetests you are running. On the Configuration tab, under the Nosetests section, make sure the checkbox in front of Params is checked and then add -s as a parameter to it. Apply and Save.

Upvotes: 2

Kristin Riggs Hampsten
Kristin Riggs Hampsten

Reputation: 111

Under the "Tools" menu, select "Edit Configurations." In the dialog, expand "Python tests" and select the nosetests you are running. Add "-s" as an "Additional Argument".

Upvotes: 11

Oleksiy
Oleksiy

Reputation: 6567

Most likely your nose runner suppressing stdout. Try running nosetests with -s

Upvotes: 20

Related Questions