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

能否支持类似unittest中的skip注解,方便灵活剔除某些用例,不执行。 #96

Closed
TommyXie1990 opened this Issue Feb 7, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@TommyXie1990

TommyXie1990 commented Feb 7, 2018

背景:
目前在接口测试日常构建中,会遇到一些接口开发暂时屏蔽了或者降级,导致用例执行失败;所以想当遇到这些情况的时候,能够临时剔除掉某些用例不执行;等后续恢复后,再去掉,然后恢复执行。

@debugtalk

This comment has been minimized.

Collaborator

debugtalk commented Feb 7, 2018

新增支持skip参数:

1、指定skipTrue时,相当于指定times为0,当前test将不运行;
2、skip参数的优先级高于times,当同时指定skipTrue,并且times为非零值时,当前test仍将不运行。

debugtalk pushed a commit that referenced this issue Feb 8, 2018

@debugtalk debugtalk reopened this Feb 8, 2018

debugtalk pushed a commit that referenced this issue Feb 8, 2018

httprunner
#96: refactor skip feature:
1, with skip keyword, skip current test unconditionally;
2, with skipIf keyword, you can skip current test with condition; condition evaluation can be defined in debugtalk.py function.
@debugtalk

This comment has been minimized.

Collaborator

debugtalk commented Feb 8, 2018

已经对skip机制进行重构:

1、支持skip关键字,指定的内容不再是boolean值,而是skip的原因;
2、支持skipIf关键字,支持指定${func()}形式的函数表达式,并根据表达式的运算结果来判断是否skip当前测试;该函数同样定义在debugtalk.py的函数中。

e.g.

测试案例:https://github.com/HttpRunner/HttpRunner/blob/master/tests/data/demo_testset_cli.yml

对应的测试报告形式:

image

@debugtalk debugtalk closed this Feb 8, 2018

debugtalk pushed a commit that referenced this issue Feb 8, 2018

debugtalk pushed a commit that referenced this issue Feb 8, 2018

httprunner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment