【测试】【Debug】vscode pytest 找不到测试用例测试文件 行号部位没有绿色箭头

出现这种情况首先检查:

  1. 是否安装pytest
  2. 点击vscode的这个图标
  3. 如果其中都是空的,没有识别上,并且写好的.py测试文件的行号前面没有运行符号,要检查名称是否按照pytest的要求写,不然会识别不到
    命名规则注意:
    文件名必须得是 test_ 开头 或者 _test 结尾;
    类要用Test_开头,方法用test_开头,这样行号会出现绿色运行箭头
    测试类中不可以添加__init__构造函数,如果添加则不认为是测试类,所有测试方法都识别不到了
相关推荐
m0_6324825010 小时前
Jenkins + Pytest +allure接口自动化测试配置与操作
jenkins·集成测试·pytest·jenkins配置
李星星BruceL10 小时前
Pytest第三章(参考指南1)
python·自动化·pytest
哎呀呦呵10 小时前
pytest基本使用
python·pytest
Kristen_YXQDN10 小时前
PyCharm 中 pytest 运行 python 测试文件报错:D:\Python_file\.venv\Scripts\python.exe: No module named pytest
运维·开发语言·python·pycharm·pytest
Low--Key10 小时前
pytest框架快速入门
python·自动化·pytest
姜西西_10 小时前
自动化测试框架pytest之fixture
android·java·pytest
测试开发Kevin10 小时前
超级实用!汇总pytest中那些常用的参数
单元测试·pytest
Beaman102410 小时前
pytest框架
python·pytest
昔时扬尘处1 天前
【Files Content Replace】文件夹文件内容批量替换自动化测试脚本
c语言·python·pytest·adi
我的xiaodoujiao1 天前
使用 Python 语言 从 0 到 1 搭建完整 Web UI自动化测试学习系列 32--开源电商商城系统项目实战--如何区分登录状态
python·学习·测试工具·pytest