2013_chengdu_visit

4716    A Computer Graphics Problem     
签到题目,模拟。
4717    The Moving Points  
求n个点的最大距离最小值,三分时间即可       
4718    The LCIS on the Tree   
LCT动态树       
4719    Oh My Holy FFF        
4720    Naive and Silly Muggles
求三角形外心为圆心的圆,简单几何题目。       
4721    Food and Productivity         
4722    Good Numbers  
基础数位dp        
4723    How Long Do You Have to Draw          
4724    If You Know This,You Must Have NO GF          
4725    The Shortest Path in Nya Graph 
特殊建图,优先队列版Dijkstra       
4726    Kia's Calculation
贪心,特殊处理第一位,剩下的往最大的贪。         
4727    The Number Off of FFF       
签到题目,暴力。
在使用 `pytest` 配合 Allure 生成测试报告时,若出现 `ERROR: file or directory not found: --alluredir D:\dsc_chengdu\dcs_api\report\allure-results` 错误,通常意味着命令行参数 `--alluredir` 的使用方式存在问题。以下是可能原因及解决方法: 1. **确保已正确安装 Allure 插件** 在使用 `--alluredir` 参数前,必须确认已经通过 `pip install allure-pytest` 安装了 Allure 的 pytest 插件。缺少该插件会导致 pytest 无法识别 `--alluredir` 参数[^4]。 2. **检查路径是否存在** 如果指定的输出目录(如 `D:\dsc_chengdu\dcs_api\report\allure-results`)不存在,某些情况下会导致文件系统错误。可以在运行测试前手动创建该目录,或使用脚本自动创建: ```python import os report_dir = "D:\\dsc_chengdu\\dcs_api\\report\\allure-results" if not os.path.exists(report_dir): os.makedirs(report_dir) ``` 3. **修正 pytest.ini 中的配置格式** 若在 `pytest.ini` 文件中配置了 `addopts`,需要确保参数书写规范。例如,以下写法可能导致解析错误: ```ini addopts = --alluredir = ./allure-results ``` 正确的写法应避免在等号两侧添加空格: ```ini addopts = --alluredir=./allure-results ``` 4. **直接在命令行中指定参数而非依赖配置文件** 有时即使 `pytest.ini` 配置无误,也可能因项目结构复杂导致参数未被正确读取。可以尝试直接在命令行中指定 `--alluredir` 参数以排除配置文件干扰: ```bash pytest --alluredir=D:\dsc_chengdu\dcs_api\report\allure-results ``` 5. **验证 Python 和 pytest 环境变量是否正常** 在跨平台迁移(如从本地环境迁移到服务器)时,需确保目标环境中的 Python 和 pytest 版本与原环境一致,并且所有依赖项均已安装完整[^4]。 6. **避免重复使用 `--alluredir` 参数** 如果在命令行或配置文件中多次指定了 `--alluredir`,则会引发冲突。请确保该参数仅出现一次[^3]。 ### 示例:完整的测试执行与报告生成流程 ```bash # 安装 Allure 插件 pip install allure-pytest # 执行测试并生成 Allure 结果 pytest --alluredir=D:\dsc_chengdu\dcs_api\report\allure-results # 使用 Allure 命令行工具生成 HTML 报告 allure generate D:\dsc_chengdu\dcs_api\report\allure-results -o D:\dsc_chengdu\dcs_api\report\allure-report --clean ```
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值