Tom*_*ski 6 python intellij-idea pytest
我想使用 pytest 编写我的测试并能够在 IntelliJ 中(单独)运行它们。我已经安装了 pytest,以及(显然)IDE 的 Python 插件。
我的测试文件 ( tests/test_main.py) 看起来像这样:
from app.main import sum_numbers
def test_sum_numbers():
assert sum_numbers(1, 2) == 3
assert sum_numbers(10, 20) == 30
assert sum_numbers(1, 2, -3) == 0
Run Code Online (Sandbox Code Playgroud)
运行pytest从终端完美的作品。但 IntelliJ 似乎将其视为常规文件,声明前没有“运行”图标。此外,从 IDE 运行该文件没有任何作用,因为它不被视为测试文件。
我能做什么?
| 归档时间: |
|
| 查看次数: |
1282 次 |
| 最近记录: |