本文整理汇总了Python中lettuce.registry.STEP_REGISTRY.clear方法的典型用法代码示例。如果您正苦于以下问题:Python STEP_REGISTRY.clear方法的具体用法?Python STEP_REGISTRY.clear怎么用?Python STEP_REGISTRY.clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lettuce.registry.STEP_REGISTRY
的用法示例。
在下文中一共展示了STEP_REGISTRY.clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_after_each_all_is_executed_before_each_all
# 需要导入模块: from lettuce.registry import STEP_REGISTRY [as 别名]
# 或者: from lettuce.registry.STEP_REGISTRY import clear [as 别名]
def test_after_each_all_is_executed_before_each_all():
"""terrain.before.each_all and terrain.after.each_all decorators"""
from lettuce import step
from lettuce import Runner
from lettuce.registry import STEP_REGISTRY
from lettuce.terrain import before, after, world
world.all_steps = []
STEP_REGISTRY.clear()
@before.all
def set_state_to_before():
world.all_steps.append('before')
@step('append 1 in world all steps')
def append_1_in_world_all_steps(step):
world.all_steps.append("1")
@step('append 2 more')
def append_2_more(step):
world.all_steps.append("2")
@step('append 3 in world all steps')
def append_during_to_all_steps(step):
world.all_steps.append("3")
@after.all
def set_state_to_after(total):
world.all_steps.append('after')
runner = Runner(join(abspath(dirname(__file__)),
'simple_features', '2nd_feature_dir'))
runner.run()
assert_equals(
world.all_steps,
['before', '1', '2', '3', 'after']
)