Python 您如何配置 PyCharm 以使用 -s 等命令行选项运行 py.test?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27868516/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do you configure PyCharm to run py.test with command-line options like -s?
提问by Jason S
I figured out how to run py.test files from PyCharm:
我想出了如何从 PyCharm 运行 py.test 文件:
- 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
- 运行/调试配置
- 在 Python 测试类别中,单击“+”按钮添加新配置
- 选择
py.test
- 输入目标脚本的完整路径和工作目录
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.)
但我似乎无法添加-s
选项以允许我的测试脚本以未捕获和隐藏的标准输出运行。(我-s
在解释器选项下尝试过,但似乎没有做任何事情。)
How can I enable -s
?
我怎样才能启用-s
?
采纳答案by Jason S
D'oh, I figured it out after all:
D'oh,毕竟我想通了:
You add it in the py.tests Options area of the Run/Edit configuration dialog.
您将它添加到运行/编辑配置对话框的 py.tests 选项区域中。