utx icon indicating copy to clipboard operation
utx copied to clipboard

控制台打印的测试用例数量和index不对

Open chengguanghua opened this issue 6 years ago • 1 comments

2019-10-19 16:35:17,300 WARNING doctest.test_skip没有用例描述 2019-10-19 16:35:17,319 WARNING test_baidu.test_timedistance_v0没有用例描述 2019-10-19 16:35:17,319 INFO 开始测试,用例数量总共10个,跳过0个,实际运行10个 2019-10-19 16:35:17,420 INFO start to test test_baidu.test_timedistance_v0 (2/10) 2019-10-19 16:35:17,519 INFO start to test test_baidu.test_timedistance_v0 (3/10) 2019-10-19 16:35:17,619 INFO start to test test_tattle.test_get_battle_reward (9/10) 2019-10-19 16:35:17,720 INFO start to test test_tattle.test_get_battle_reward (10/10) 2019-10-19 16:35:17,819 INFO start to test test_tattle.test_bless (4/10) 2019-10-19 16:35:17,920 INFO start to test test_tattle.test_bless (5/10) 2019-10-19 16:35:18,019 INFO start to test test_tattle.test_receive_bless_box (6/10) 2019-10-19 16:35:18,119 INFO start to test test_tattle.test_receive_bless_box (7/10) 2019-10-19 16:35:18,220 INFO start to test test_tattle.test_receive_bless_box (8/10) 2019-10-19 16:35:18,220 INFO Time Elapsed: 0:00:00.900000

真实情况是用例只有9个,统计结果是10个,index也有点问题,不是从第1个开始计数

chengguanghua avatar Oct 19 '19 08:10 chengguanghua

根本原因没有找到,但是提供一个规避的方法,在core.py的Meta类的__new__方法 【# 注入测试数据】逻辑之前加入以下代码可以解决问题 if case_info == "doctest.test_skip": continue

BirdLearn avatar Aug 13 '20 11:08 BirdLearn