报错:pytest: error: argument -m: expected one argument (via addopts config)

错误:ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]

pytest: error: argument -m: expected one argument (via addopts config)

原因:pytest.ini里面-m应该去掉,因为没指定标签。

复制代码
[pytest]
markers=
        smoke:冒烟测试
        system:系统测试
addopts=-v -s -m
testpaths=../pytest_test

应改为

复制代码
[pytest]
markers=
        smoke:冒烟测试
        system:系统测试
addopts=-v -s
testpaths=../pytest_test
相关推荐
A_Tai233333310 小时前
PyTest
pytest
bjwuzh6 天前
使用pytest实现参数化后,控制台输出的日志是乱码
pytest
2025年一定要上岸6 天前
pytest框架 - 第二集 allure报告
pytest
头疼的程序员8 天前
allure生成测试报告(搭配Pytest、allure-pytest)
测试工具·pytest
文人sec8 天前
接口自动化测试设计思路--设计实战
python·https·单元测试·自动化·pytest
测试开发Kevin10 天前
从投入产出、效率、上手难易度等角度综合对比 pytest 和 unittest 框架
python·pytest
测试开发Kevin12 天前
以pytest_addoption 为例,讲解pytest框架中钩子函数的应用
python·pytest
川石教育18 天前
Pytest中的fixture装饰器详解
python自动化测试·pytest·pytest自动化测试框架·pytest测试框架·pytest单元测试框架
春风又。18 天前
接口自动化——参数化
python·测试工具·自动化·pytest
XTY0020 天前
mac电脑pytest生成测试报告
pytest