本文整理匯總了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']
)