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