PyCharm执行文件,而不是pytest

问题描述 投票:-1回答:1

在PyCharm中,我的默认测试运行程序为pytest。有绿色的播放按钮,但是如果我按下按钮并执行“ run pytest for ...”,则将执行python文件。但是,当然我希望通过pytest执行特定的方法。

green-play-buttons--pycharm

这里是结果:

run-python

但是它应该看起来像这样:

pytest-gets-executed

相关问题:PyCharm: FooTestCase is no test, but FooTest is

python-2.7 pycharm
1个回答
0
投票

是的,您也可以在pycharm中运行代码的特定部分。

转到文件->设置->键盘映射

搜索-> Execute Selection in Console并为其重新分配密钥。

© www.soinside.com 2019 - 2024. All rights reserved.