在PyCharm中,我的默认测试运行程序为pytest。有绿色的播放按钮,但是如果我按下按钮并执行“ run pytest for ...”,则将执行python文件。但是,当然我希望通过pytest执行特定的方法。
pytest
这里是结果:
但是它应该看起来像这样:
相关问题:PyCharm: FooTestCase is no test, but FooTest is
是的,您也可以在pycharm中运行代码的特定部分。
转到文件->设置->键盘映射
搜索-> Execute Selection in Console并为其重新分配密钥。
Execute Selection in Console