简体   繁体   English

行为(适用于Python的BDD)支持示例标记

[英]Behave (BDD for Python) supports Examples tagging

I am looking to apply tags that works for scenarios & features to examples in following way. 我希望通过以下方式将适用于场景和功能的标签应用于示例。 It seems to work for cucumber but not for Behave- a BDD framework for Python: 它似乎适用于黄瓜,但不适用于Behave-适用于Python的BDD框架:

Scenario Outline: Something useful
 Given I have <a> 
 When I add <b>
 Then I should have <c>

 Examples: Implemented things 
  | a | b | c | 
  | 0 | 0 | 0 |

 @pending 
 Examples: Not yet implemented things 
  | a | b | c | 
  | 1 | 2 | 3 |

Firstly, make sure you have Behave 1.2.5 首先,请确保您具有1.2.5的行为

pip show behave

If it is not Behave 1.2.5, then install the latest version. 如果不是行为1.2.5,则安装最新版本。

pip install git+https://github.com/behave/behave

Secondly, you may need to apply quote marks around your place holders. 其次,您可能需要在占位符周围加上引号。 For Example. 例如。

Given I have "<a>"
When I add "<b>"
Then I should have "<c>"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM