【问题标题】:How to debug/run pytest in GoLand IDE?如何在 GoLand IDE 中调试/运行 pytest?
【发布时间】:2019-11-15 18:44:53
【问题描述】:

我正在尝试在独立终端中使用 py.test 运行 python 测试,它运行良好。

但是当我尝试在 GoLandIDE 中运行相同的 pytests 时(通过选择测试方法,右键单击 -> run as 或 debug as ,测试不起作用并以以下输出退出。

任何指针都会非常有帮助。谢谢。

/usr/bin/python3.7 /home/vagrant/go_workspace/src/github.com/mytests/tests/test_permissions_account.py

Process finished with exit code 0

/usr/bin/python3.7 /home/vagrant/.GoLand2019.2/config/plugins/python-ce/helpers/pydev/pydevd.py --multiproc --qt-support=auto --client 127.0.0.1 --port 46219 --file /home/vagrant/go_workspace/src/github.com/mytest/tests/test_permissions_account.py
pydev debugger: process 21581 is connecting

Connected to pydev debugger (build 192.7142.48)

Process finished with exit code 0

【问题讨论】:

    标签: pycharm ide pytest goland


    【解决方案1】:

    将 python 默认测试运行器编辑为 pytest,如图所示,并通过显式标记它们来确保将所有相对路径添加为源。

    只需下载 PyCharm 社区版,它提供了更复杂的方法来推断相对路径,将默认测试运行器更改为 pytest。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-01
      • 1970-01-01
      • 2023-03-27
      • 1970-01-01
      • 1970-01-01
      • 2021-10-06
      相关资源
      最近更新 更多