一、问题
代码中有添加@pytest.mark.httptest标签,执行命令运行指定标签的case:
 pytest -m httptest
 
 Pytest框架通过打标签执行测试用例,执行命令:pytest -m httptest
 报PytestUnknownMarkWarning: Unknown pytest.mark.httptest - is this a typo?
 
二、解决方案
解决方案:添加pytest.ini 配置文件,给标签注册
在你项目的任意一个文件下,新建一个file,文件命名为pytest.ini:
 [pytest]
 markers =
 httptest: run http interface test
 dubbotest: run dubbo interface test
 冒号之后是描述信息(可写可不写)
 如下图:
 
 再次运行,警告就没有了~
=========================================================
 以上就是本篇文章的全部内容,如果对你有帮助,










