报错: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
相关推荐
边吃番茄边敲代码1 天前
从本地工具到 MCP:给 Agent 接入独立工具服务,并补齐自动化测试
人工智能·python·功能测试·ai·单元测试·pytest
SugarAbsinthe1 天前
【Agent开发实习小记】从人工逐条验证到自动化验收:新 API 接入前的效率瓶颈
人工智能·python·自动化·pytest
X1A0RAN2 天前
pytest 动态报告:数据可视化篇 —— 用 Golang + Echo 打造自动化测试任务可视化平台
信息可视化·golang·pytest
吨吨ai2 天前
Codex 实战:用 Git 分支 + pytest 构建可回滚的 AI 开发流程(2026年8月27日)
人工智能·git·pytest
冷凝娇5 天前
【Pytest】2026 学习总结
学习·pytest
测试老哥7 天前
Pytest自动化测试框架tep环境变量、fixtures、用例三者之间的关系
自动化测试·软件测试·python·测试工具·测试用例·pytest·职场发展
小小测试开发7 天前
Agent 安全测试:pytest 原生红队框架 RAMPART 实战解析
人工智能·pytest
不拘一格的叶三少11 天前
Pytest + Playwright 自动化测试工程设计要点 & 目录结构
测试工具·pytest