不能在Python Console中运行pytest

在Python Console中运行pytest发现报错了

不能在Python Console中运行pytest_第1张图片

 

这是为什么?因为Python Console已经是进入python之后的环境,就像在python自带的IDLE中运行pytest

不能在Python Console中运行pytest_第2张图片

pytest的运行是不需要进入python环境的,因此可以在Terminal命令行中运行pytest,结果是ok的

不能在Python Console中运行pytest_第3张图片

 

 

 

转载于:https://www.cnblogs.com/my_captain/p/9384882.html

你可能感兴趣的:(不能在Python Console中运行pytest)