| 【test】 补全 cli/app/flat_quant 三模块单测,达 80% 行覆盖门禁
Co-authored-by: rookie_hongchuan<hongchuan6@h-partners.com>
# message auto-generated for no-merge-commit merge:
!471 merge feature/ut-coverage into master
【test】 补全 cli/app/flat_quant 三模块单测,达 80% 行覆盖门禁
Created-by: rookie_hongchuan
Commit-by: rookie_hongchuan
Merged-by: ascend-robot
Description: ## PR描述 (What this PR does / why we need it?)
补全 msmodelslim/cli + app + processor/flat_quant 三模块单测覆盖,达到行覆盖率 80% / 分支覆盖率 60% 门禁。
新增 21 个单测文件,覆盖正常/边界/异常三类情形,模块聚合行覆盖 85% / 分支覆盖 80%(全部达标)。
## 面向用户的变更 (Does this PR introduce _any_ user-facing change?)
无。仅新增单测,不修改业务源码。
## 功能验证 (How was this patch tested?)
- [x] 功能自验:pytest test/cases/app/ test/cases/cli/ test/cases/processor/flat_quant/ test/smoke/ → 402 passed, 48 skipped, 3 xfailed
- [x] 覆盖率:三模块行覆盖 81%-98%,均过 80% 门禁
### 覆盖明细
| 模块 | 行覆盖 | 分支覆盖 |
|------|--------|---------|
| msmodelslim/cli/ | 98% | 95% |
| msmodelslim/processor/flat_quant/ | 84% | 75% |
| msmodelslim/app/ | 81% | 76% |
### 新增单测文件(21 个)
- test/cases/cli/ — test_utils.py, test_cli_main.py, test_naive_main.py, test_analysis_main.py, test_tuning_main.py
- test/cases/app/auto_tuning/ — test_application.py, test_evaluation_service_infra.py, test_model_info_interface.py, test_plan_manager_infra.py, test_practice_accuracy_infra.py, test_practice_history_infra.py, test_practice_manager_infra.py
- test/cases/app/naive_quantization/ — test_application_helpers.py
- test/cases/processor/flat_quant/flat_quant_utils/ — test_fqu_utils.py, test_trans_matrix.py, test_flat_quant_manager.py, test_fake_clip_quantizer.py, test_flat_fake_quant_linear.py, test_structure_pair.py, test_structure_pair_real.py
- test/smoke/ — test_flat_quant.py
See merge request: Ascend/msmodelslim!471 | 1 天前 |