pytest下放pytest.ini文件就导致报错:ERROR: file or directory not found: #

pytest下放pytest.ini文件就导致报错:ERROR: file or directory not found: #

如下:

项目文件目录如下:

pytest.ini文件内容:

python 复制代码
[pytest]
addopts = -v -s --alluredir = ./allure-results  # 自动添加的命令行参数:
                                              # -v:详细输出
                                              # -s:打印输出信息
                                              # --alluredir:指定Allure结果保存目录
testpaths = test_cases       # 指定测试目录
python_files = test_*.py     # 匹配测试文件模式

怎么改路径就是报错,没办法只能把这个文件pytest.ini去掉l,在cmd里手动写执行命令了pytest -vs --alluredir=./result/ --clean-alluredir

allure generate ./result2 -o ./report2 --clean

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