不能在Python Console中运行pytest

不能在Python Console中运行pytest

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

不能在Python Console中运行pytest

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

不能在Python Console中运行pytest

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

不能在Python Console中运行pytest