Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
chengguanghua opened this issue Oct 19, 2019 · 1 comment
Open

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

chengguanghua opened this issue Oct 19, 2019 · 1 comment

Comments

@chengguanghua
Copy link

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个开始计数

@BirdLearn
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants