Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you configure PyCharm to run py.test with command-line options like -s?

I figured out how to run py.test files from PyCharm:

  • Run/Debug configurations
  • in the Python tests category, click the "+" button to add a new configuration
  • choose py.test
  • enter the full path for the Target script and the working directory

but I can't seem to add the -s option to allow my test script to run with standard output not captured and hidden. (I tried -s under interpreter options but it appears not to do anything.)

How can I enable -s?

like image 632
Jason S Avatar asked Jan 09 '15 20:01

Jason S


People also ask

How do I run single pytest in PyCharm?

PyCharm makes it easy to select just one test to run. In fact, there are several ways to do it: With the cursor anywhere in the test you want to focus on, right-click and choose to run that in the test runner. Right-click on the test in the test tool listing and choose to run it.

How do I change the configuration in PyCharm?

From the main menu, select Run | Edit Configurations. Alternatively, press Alt+Shift+F10 , then 0 . In the left-hand pane of the run/debug configuration dialog, click Edit configuration templates…. In the Run/Debug Configuration Templates dialog that opens, select a configuration type.


1 Answers

D'oh, I figured it out after all:

enter image description here

You add it in the py.tests Options area of the Run/Edit configuration dialog.

like image 111
Jason S Avatar answered Oct 03 '22 23:10

Jason S