You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在PyCharm中移除pytest默认的--no-header等参数?

移除PyCharm中pytest自动添加的--no-header --no-summary -q参数

全局设置(所有pytest测试生效)

  • 打开PyCharm设置:按Ctrl+Alt+S(Windows/Linux)或Cmd+,(Mac)
  • 搜索并进入Tools > Python Integrated Tools
  • 在Testing板块,点击pytest右侧的齿轮图标
  • 取消勾选Suppress pytest output (--no-header, --no-summary, -q)
  • 保存设置后重启测试运行

单个测试配置修改(仅当前配置生效)

  • 点击右上角运行配置下拉框,选择Edit Configurations...
  • 选中目标pytest配置,切换到Configuration标签页
  • 在Execution区域,取消勾选Suppress pytest output
  • 保存配置后重新运行测试

完成以上操作后,PyCharm就不会自动追加这些参数,pytest将使用默认输出格式。

内容的提问来源于stack exchange,提问作者HeyMan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.07 20:45:22