Gulzar
Gulzar

Reputation: 28044

How to make pycharm dump stdout and stderr to console on running pytest?

Usint pytest on Pycharm, I have some long tests for which I want to be able to manually monitor progress of.
Things like neural network training - I want to see loss and progress bar.

Running the same code from a regular function like main() gives console output fine.

Running through a pytest test doesn't put anything to console until the test is over.


How to make pytest still output to console in Pycharm?

I found this answer and tried -s and --capture=tee-sys which do basically nothing.


Feb 03 2021 Just asked on pycharm's forum.

Upvotes: 3

Views: 1391

Answers (1)

Lior Cohen
Lior Cohen

Reputation: 5755

add -s to your Additional Arguments in the Run/Debug Configuration.

This will disable the default pytest stdout/stderr capturing.

Upvotes: 3

Related Questions