本文整理汇总了Python中pytest_bdd.scenario方法的典型用法代码示例。如果您正苦于以下问题:Python pytest_bdd.scenario方法的具体用法?Python pytest_bdd.scenario怎么用?Python pytest_bdd.scenario使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pytest_bdd
的用法示例。
在下文中一共展示了pytest_bdd.scenario方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_scenario_backtest_recipe
# 需要导入模块: import pytest_bdd [as 别名]
# 或者: from pytest_bdd import scenario [as 别名]
def test_scenario_backtest_recipe(capsys):
""" BIZARRE SIDE EFFECT if you dont have capsys in the scenario function:
tests/features/test_OTCmd2.py:69: in vTestWhen
sOut, sErr = capsys.readouterr()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.capture.CaptureFixture instance at 0xb0f66fcc>
def readouterr(self):
try:
return self._capture.readouterr()
except AttributeError:
> return self._outerr
E AttributeError: CaptureFixture instance has no attribute '_outerr'
/usr/lib/python2.7/site-packages/_pytest/capture.py:198: AttributeError
"""
pass
示例2: test_scenario_backtest_omlette
# 需要导入模块: import pytest_bdd [as 别名]
# 或者: from pytest_bdd import scenario [as 别名]
def test_scenario_backtest_omlette(capsys):
# FixMe: How do you get the arguments to @scenario in pytest_bdd
pass
示例3: test_file_with_scenario
# 需要导入模块: import pytest_bdd [as 别名]
# 或者: from pytest_bdd import scenario [as 别名]
def test_file_with_scenario(testdir, scenario, feature):
testdir.makepyfile(current_test="""
from pytest_bdd import scenario
@scenario("{feature}.feature", "{scenario}")
def test_it():
pass
""".format(scenario=scenario, feature=feature))