报错: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
相关推荐
姚青&13 天前
PyCharm 配置与界面化运行
pytest
姚青&13 天前
Pytest 测试用例断言
测试用例·pytest
姚青&13 天前
Pytest 命名规则
pytest
姚青&13 天前
Pytest 测试用例结构
测试用例·pytest
姚青&13 天前
Pytest 简介、安装与环境准备
pytest
测试渣14 天前
持续集成中的自动化测试框架优化实战指南
python·ci/cd·单元测试·自动化·pytest
小凯1234514 天前
pytest框架-详解(学习pytest框架这一篇就够了)
python·学习·pytest
逻极14 天前
pytest 入门指南:Python 测试框架从零到一(2025 实战版)
开发语言·python·pytest