Module Expr Str Import alias Import alias Import alias Import alias Import alias ImportFrom alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias alias ImportFrom alias alias alias alias alias alias ImportFrom alias ImportFrom alias If AttributeLoad NameLoad attr body Import alias FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str For TupleStore NameStore NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr body For NameStore NameLoad body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Str NameLoad Assign NameStore IfExp NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad If NameLoad body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Str Dict For TupleStore NameStore NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr body If CompareIn NameLoad NameLoad body Assign NameStore Call SubscriptLoad NameLoad Index NameLoad NameLoad If NameLoad body Expr Call NameLoad NameLoad NameLoad NameLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad If NameLoad body TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr body Continue Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr TryExcept body Return Call AttributeLoad NameLoad attr Call NameLoad NameLoad AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr body TryExcept body Assign NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad If NameLoad body Return Call AttributeLoad NameLoad attr NameLoad Raise handlers ExceptHandler type AttributeLoad NameLoad attr body Raise Call AttributeLoad NameLoad attr Call AttributeLoad Str attr keyword NameLoad keyword NameLoad keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad keyword NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad Assign SubscriptStore NameLoad Index Str Dict TryExcept body Assign NameStore Call NameLoad GeneratorExp TupleLoad NameLoad Call AttributeLoad NameLoad attr NameLoad comprehension NameStore Call NameLoad NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad Expr Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr keyword NameLoad NameLoad Raise decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr keyword NameLoad keyword NameLoad keyword NameLoad TryFinally body Assign NameStore Call NameLoad For NameStore AttributeLoad NameLoad attr body TryExcept body Assign NameStore Call NameLoad NameLoad NameLoad NameLoad keyword NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr name NameStore body Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Raise TryExcept body If CompareEq AttributeLoad NameLoad attr NameLoad body If CompareIn AttributeLoad NameLoad attr NameLoad body Raise Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr handlers ExceptHandler type AttributeLoad NameLoad attr name NameStore body Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Raise Expr Call NameLoad NameLoad NameLoad NameLoad NameLoad finalbody Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr keyword NameLoad keyword NameLoad keyword NameLoad decorator_list Assign NameStore Call AttributeLoad NameLoad attr Str ListLoad Str FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Assign NameStore ListLoad If CompareIn Str Call NameLoad NameLoad body Assign NameStore ListLoad Call NameLoad keyword NameLoad Return Call NameLoad NameLoad decorator_list If CompareIs NameLoad NameLoad body If Call NameLoad NameLoad NameLoad body Return Call NameLoad Call NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr If Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Assign NameStore Dict Expr Call NameLoad NameLoad NameLoad If CompareIn NameLoad NameLoad body Return Call NameLoad SubscriptLoad NameLoad Index NameLoad orelse Return Call NameLoad Call NameLoad NameLoad NameLoad Return Call NameLoad NameLoad NameLoad keyword Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Assign NameStore Call NameLoad NameLoad NameLoad FunctionDef arguments args NameParam defaults body If Call NameLoad NameLoad AttributeLoad NameLoad attr body Raise Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad For NameStore Call AttributeLoad NameLoad attr body If CompareNotIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad If CompareNotIn Str NameLoad body Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad Str attr keyword AttributeLoad NameLoad attr keyword Call AttributeLoad Str attr NameLoad keyword Call AttributeLoad Str attr NameLoad Expr Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad SubscriptLoad NameLoad Index AttributeLoad NameLoad attr keyword NameLoad keyword AttributeLoad NameLoad attr For NameStore Call AttributeLoad NameLoad attr body If NameLoad body Assign NameStore Call Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad For NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr body Assign NameStore Call Call NameLoad AttributeLoad NameLoad attr NameLoad NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad Str attr keyword NameLoad keyword NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list Return Call NameLoad NameLoad keyword NameLoad keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults Str NameLoad NameLoad NameLoad body Expr Str Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore BoolOpOr NameLoad Call NameLoad Assign NameStore BoolOpOr NameLoad Call NameLoad Assign NameStore Call NameLoad NameLoad Str Assign NameStore Call NameLoad NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad keyword NameLoad TryExcept body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad handlers ExceptHandler type NameLoad body Raise Call AttributeLoad NameLoad attr Call AttributeLoad Str attr keyword NameLoad keyword BoolOpOr AttributeLoad NameLoad attr Str keyword AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Return Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Call AttributeLoad NameLoad attr Str Str Return Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad Str NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Str Assign NameStore Num FunctionDef arguments args defaults body Return Call AttributeLoad Str attr NameLoad NameLoad decorator_list While NameLoad body Expr Yield Call NameLoad AugAssignAdd NameStore Num Assign NameStore Call AttributeLoad Str attr NameLoad decorator_list FunctionDef arguments args defaults vararg kwarg body Expr Str Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr Index Num Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num Assign NameStore Call NameLoad NameLoad Str Assign NameStore Call NameLoad NameLoad Str Assign NameStore ListLoad For NameStore NameLoad body If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore NameLoad Assign NameStore Call NameLoad GeneratorExp TupleLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad AttributeLoad NameLoad attr attr comprehension TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad NameLoad Str Assign NameStore Num For NameStore Call NameLoad NameLoad keyword NameLoad body For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body If CompareNotIn TupleLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad body FunctionDef arguments args defaults body Pass decorator_list Call NameLoad AttributeLoad NameLoad attr NameLoad NameLoad For NameStore Call NameLoad NameLoad body If CompareNotIn NameLoad AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad keyword NameLoad keyword BinOpMult NameLoad Num AugAssignAdd NameStore Num Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad Break Assign NameStore NameLoad If UnaryOpNot NameLoad body Raise Call AttributeLoad NameLoad attr NameLoad decorator_list
N/A N/A Scenario implementation.

The pytest will collect the test case and the steps will be executed
line by line.

Example:

test_publish_article = scenario(
    feature_name="publish_article.feature",
    scenario_name="Publishing the article",
)
 N/A collections N/A inspect N/A os N/A re N/A pytest _pytest python N/A six N/A exceptions N/A fixtures feature Feature force_encode force_unicode get_features steps execute get_caller_function get_caller_module get_step_fixture_name inject_fixture recreate_function types GIVEN utils get_args N/A N/A six PY3 N/A N/A runpy execfile N/A N/A filename init_globals N/A N/A N/A Execute given file as a python script in given globals environment. N/A result N/A N/A runpy run_path filename init_globals init_globals N/A N/A N/A init_globals update result N/A N/A PYTHON_REPLACE_REGEX N/A N/A re compile \W N/A ALPHA_REGEX N/A N/A re compile ^\d+_* find_argumented_step_fixture_name N/A N/A name type_ fixturemanager request N/A None N/A N/A Find argumented step fixture name. N/A N/A fixturename fixturedefs N/A list N/A N/A N/A fixturemanager _arg2fixturedefs items N/A N/A fixturedef fixturedefs N/A N/A parser N/A getattr N/A fixturedef func parser None N/A match N/A parser N/A N/A parser is_matching name None N/A match N/A N/A converters N/A getattr N/A fixturedef func converters N/A N/A N/A arg value N/A N/A N/A N/A parser parse_arguments name items N/A N/A N/A arg converters N/A N/A value N/A N/A converters N/A arg value N/A request N/A N/A N/A inject_fixture request arg value N/A parser_name N/A get_step_fixture_name N/A parser name type_ N/A request N/A N/A N/A N/A N/A N/A request getfuncargvalue parser_name N/A N/A N/A N/A python FixtureLookupError N/A N/A N/A parser_name N/A _find_step_function N/A N/A request step scenario encoding N/A N/A N/A Match the step defined by the regular expression pattern.

    :param request: PyTest request object.
    :param step: Step.
    :param scenario: Scenario.

    :return: Function of the step.
    :rtype: function
     N/A name N/A step name N/A N/A N/A N/A N/A request getfuncargvalue N/A get_step_fixture_name name N/A step type encoding N/A N/A N/A N/A python FixtureLookupError N/A N/A N/A N/A name N/A find_argumented_step_fixture_name name N/A step type N/A request _fixturemanager request N/A name N/A N/A N/A N/A request getfuncargvalue name N/A N/A N/A N/A N/A python FixtureLookupError N/A N/A N/A N/A exceptions StepDefinitionNotFoundError N/A N/A Step definition is not found: {step}. Line {step.line_number} in scenario "{scenario.name}" in the feature "{feature.filename} format step step scenario scenario feature N/A scenario feature N/A _execute_step_function N/A N/A request scenario step step_func N/A N/A N/A Execute step function.

    :param request: PyTest request.
    :param scenario: Scenario.
    :param step: Step.
    :param function step_func: Step function.
    :param example: Example table.
     N/A kw N/A dict request request feature N/A scenario feature scenario scenario step step step_func step_func N/A N/A N/A N/A N/A request config hook pytest_bdd_before_step kw N/A N/A kw N/A step_func_args N/A N/A N/A N/A kwargs N/A dict N/A N/A arg N/A N/A request getfuncargvalue arg N/A arg N/A get_args step_func N/A N/A kw N/A step_func_args kwargs N/A N/A N/A N/A N/A request config hook pytest_bdd_before_step_call kw N/A N/A step_func kwargs N/A N/A N/A N/A N/A request config hook pytest_bdd_after_step kw N/A N/A N/A Exception N/A exception N/A N/A N/A N/A N/A N/A request config hook pytest_bdd_step_error exception exception kw N/A N/A _execute_scenario N/A N/A feature scenario request encoding N/A N/A N/A Execute the scenario.

    :param feature: Feature.
    :param scenario: Scenario.
    :param request: request.
    :param encoding: Encoding.
     N/A N/A N/A N/A N/A request config hook pytest_bdd_before_scenario request request feature feature scenario scenario N/A N/A N/A givens N/A set N/A step N/A scenario steps N/A N/A N/A N/A step_func N/A _find_step_function request step scenario encoding encoding N/A N/A N/A N/A exceptions StepDefinitionNotFoundError N/A exception N/A N/A N/A N/A N/A N/A request config hook pytest_bdd_step_func_lookup_error request request feature feature scenario scenario step step exception exception N/A N/A N/A N/A N/A N/A step type GIVEN N/A N/A N/A N/A step_func fixture givens N/A N/A N/A N/A exceptions GivenAlreadyUsed N/A N/A Fixture "{0}" that implements this "{1}" given step has been already used. format N/A step_func fixture N/A step name N/A N/A N/A givens add N/A step_func fixture N/A N/A N/A N/A exceptions ScenarioValidationError N/A exception N/A N/A N/A N/A N/A N/A request config hook pytest_bdd_step_validation_error request request feature feature scenario scenario step step step_func step_func exception exception N/A N/A N/A _execute_step_function request scenario step step_func N/A N/A N/A N/A N/A N/A request config hook pytest_bdd_after_scenario request request feature feature scenario scenario N/A N/A FakeRequest N/A N/A collections namedtuple FakeRequest N/A module get_fixture N/A N/A caller_module fixture path N/A None N/A N/A Get first conftest module from given one. call_fixture N/A N/A function N/A N/A N/A args N/A N/A N/A request N/A get_args function N/A N/A args N/A N/A FakeRequest module caller_module N/A N/A function args N/A N/A N/A path None N/A N/A N/A hasattr caller_module fixture N/A N/A N/A call_fixture N/A getattr caller_module fixture N/A path N/A N/A N/A os path dirname N/A caller_module __file__ N/A N/A N/A N/A os path exists N/A N/A N/A os path join path __init__.py N/A N/A file_path N/A N/A N/A os path join path conftest.py N/A N/A N/A N/A os path exists file_path N/A N/A globs N/A N/A N/A execfile file_path globs N/A N/A fixture globs N/A N/A N/A call_fixture N/A globs N/A fixture N/A N/A N/A call_fixture N/A getattr fixtures fixture N/A N/A get_fixture caller_module fixture path N/A N/A N/A os path dirname path N/A _get_scenario_decorator N/A N/A feature feature_name scenario scenario_name caller_module caller_function encoding N/A N/A N/A Get scenario decorator. N/A g N/A locals N/A N/A g N/A _execute_scenario _execute_scenario N/A scenario_name N/A force_encode scenario_name encoding decorator N/A N/A _pytestbdd_function N/A N/A N/A N/A isinstance _pytestbdd_function N/A python FixtureRequest N/A N/A N/A N/A exceptions ScenarioIsDecoratorOnly scenario function can only be used as a decorator. Refer to the documentation. N/A N/A N/A g update N/A locals N/A args N/A get_args _pytestbdd_function N/A function_args N/A list args N/A arg N/A N/A scenario get_example_params N/A N/A N/A arg function_args N/A N/A N/A N/A function_args append arg N/A N/A request function_args N/A N/A N/A N/A function_args append request N/A code N/A N/A def {name}({function_args}):
            _execute_scenario(feature, scenario, request, encoding)
            _pytestbdd_function({args}) format name N/A _pytestbdd_function __name__ function_args N/A N/A ,  join function_args args N/A N/A ,  join args N/A N/A execute code g N/A _scenario N/A recreate_function N/A g N/A N/A _pytestbdd_function __name__ module caller_module firstlineno N/A caller_function f_lineno N/A param_set N/A N/A scenario get_params N/A N/A param_set N/A N/A _scenario N/A N/A N/A N/A pytest mark parametrize param_set _scenario N/A tag N/A N/A N/A scenario tags union N/A feature tags N/A N/A _scenario N/A N/A getattr N/A pytest mark tag _scenario N/A N/A _scenario __doc__ N/A N/A {feature_name}: {scenario_name} format feature_name feature_name scenario_name scenario_name N/A N/A _scenario __scenario__ scenario N/A N/A scenario test_function _scenario N/A _scenario N/A N/A N/A recreate_function decorator module caller_module firstlineno N/A caller_function f_lineno N/A scenario N/A N/A feature_name scenario_name encoding example_converters caller_module caller_function N/A utf-8 None None None N/A N/A Scenario decorator.

    :param str feature_name: Feature file name. Absolute or relative to the configured feature base path.
    :param str scenario_name: Scenario name.
    :param str encoding: Feature file encoding.
    :param dict example_converters: optional `dict` of example converter function, where key is the name of the
        example parameter, and value is the converter function.
     N/A scenario_name N/A force_unicode scenario_name encoding N/A caller_module N/A caller_module N/A get_caller_module N/A caller_function N/A caller_function N/A get_caller_function N/A base_path N/A get_fixture caller_module pytestbdd_feature_base_dir N/A strict_gherkin N/A get_fixture caller_module pytestbdd_strict_gherkin N/A feature N/A N/A Feature get_feature base_path feature_name encoding encoding strict_gherkin strict_gherkin N/A N/A N/A scenario N/A N/A feature scenarios N/A scenario_name N/A N/A N/A KeyError N/A N/A N/A N/A exceptions ScenarioNotFound N/A N/A Scenario "{scenario_name}" in feature "{feature_name}" in {feature_filename} is not found. format scenario_name scenario_name feature_name N/A N/A feature name [Empty] feature_filename N/A feature filename N/A N/A scenario example_converters example_converters N/A N/A N/A scenario validate N/A N/A _get_scenario_decorator feature feature_name scenario scenario_name caller_module caller_function encoding N/A make_python_name N/A N/A string N/A N/A N/A Make python attribute name out of a given string. N/A string N/A N/A re sub PYTHON_REPLACE_REGEX N/A N/A string replace _ N/A N/A N/A N/A N/A re sub ALPHA_REGEX string lower N/A get_python_name_generator N/A N/A name N/A N/A N/A Generate a sequence of suitable python names out of given arbitrary string name. N/A python_name N/A make_python_name name N/A suffix N/A index 0 get_name N/A N/A N/A N/A N/A N/A N/A test_{0}{1} format python_name suffix N/A N/A True N/A N/A N/A N/A get_name N/A index 1 N/A suffix N/A N/A _{0} format index N/A scenarios N/A N/A N/A feature_paths kwargs N/A N/A Parse features from the paths and put all found scenarios in the caller module.

    :param *feature_paths: feature file paths to use for scenarios
     N/A frame N/A N/A N/A inspect stack N/A 1 N/A module N/A N/A inspect getmodule N/A frame N/A 0 N/A base_path N/A get_fixture module pytestbdd_feature_base_dir N/A strict_gherkin N/A get_fixture module pytestbdd_strict_gherkin N/A abs_feature_paths N/A N/A path feature_paths N/A N/A N/A N/A N/A N/A os path isabs path N/A N/A path N/A N/A N/A os path abspath N/A N/A N/A os path join base_path path N/A N/A N/A abs_feature_paths append path N/A found False N/A module_scenarios N/A frozenset N/A N/A N/A N/A N/A attr __scenario__ feature filename N/A N/A attr __scenario__ name N/A N/A name attr N/A N/A N/A module __dict__ items N/A hasattr attr __scenario__ N/A index 10 N/A feature N/A get_features abs_feature_paths strict_gherkin strict_gherkin N/A N/A N/A scenario_name scenario_object N/A N/A N/A feature scenarios items N/A N/A N/A N/A N/A N/A scenario_object feature filename scenario_name module_scenarios N/A _scenario N/A N/A N/A N/A N/A N/A N/A scenario N/A feature filename scenario_name kwargs N/A test_name N/A get_python_name_generator scenario_name N/A N/A N/A test_name N/A module __dict__ N/A N/A _scenario N/A recreate_function _scenario module module firstlineno N/A index 4 N/A index 1 N/A N/A N/A module __dict__ N/A test_name _scenario N/A N/A found True N/A N/A found N/A N/A N/A N/A exceptions NoScenariosFound abs_feature_paths N/A