我想在 PyCharm 中使用 pytest 进行单元测试。但是,如果我尝试在 PyCharm 内运行测试,如图所示。我收到如下所示的错误。我没有找到解决方法,也没有可以安装的 pytest_clicker 包。
我正在研究 Python 3.11 和 pytest 7.4.2。
为了解决这个问题,我在互联网上搜索了解决方法,但还没有找到。我重新安装了pytest。将 pytest 设置为 Python Integrated Tools 下的默认测试运行器。
可悲的是我没有进一步的想法。
我只是想在 PyCharm 中运行测试方法,而不需要运行整个脚本。
没有名为
pytest_clicker
的包。您的意思是pytest_click
吗?在 python 项目终端中运行以下命令来安装它:pip install pytest_click
.