如何在GoLand IDE中调试/运行pytest?

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

但是当我尝试在GoLandIDE中运行相同的pytest时(通过选择测试方法,右键单击-> 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

a9363001128honey 回答:如何在GoLand IDE中调试/运行pytest?

将python默认测试运行程序编辑为pytest,如图所示,并通过显式标记所有相对路径作为源将其添加为源。

OR

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

python-settings

本文链接:https://www.f2er.com/3093229.html

大家都在问