Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/pytest-dev/pytest-bdd
/ functions
Functions
291 in github.com/pytest-dev/pytest-bdd
⨍
Functions
291
◇
Types & classes
49
↓ 31 callers
Method
from_dict
(cls, data: dict[str, Any])
src/pytest_bdd/gherkin_parser.py:96
↓ 21 callers
Function
collect_dumped_objects
Parse all the objects dumped with `dump_object` from the result. Note: You must run the result with output to stdout enabled. For example, us
src/pytest_bdd/utils.py:67
↓ 5 callers
Function
prepare_testdir
(pytester, ini_base_dir)
tests/feature/test_feature_base_dir.py:60
↓ 4 callers
Function
get_tag_names
Extract tag names from tag data. Args: tag_data (List[dict]): The tag data to extract names from. Returns: set[str]: A set o
src/pytest_bdd/parser.py:48
↓ 4 callers
Method
parse
Parse the feature file and return a Feature object with its backgrounds, rules, and scenarios.
src/pytest_bdd/parser.py:481
↓ 4 callers
Function
render_string
Render the string with the given context, but avoid replacing text inside angle brackets if context is missing. Args: input_stri
src/pytest_bdd/parser.py:27
↓ 3 callers
Method
finalize
Stop collecting information and finalize the report. :param bool failed: Whether the step execution is failed.
src/pytest_bdd/reporting.py:52
↓ 3 callers
Function
get_step_fixture_name
Get step fixture name
src/pytest_bdd/steps.py:73
↓ 3 callers
Function
main
Main entry point.
src/pytest_bdd/scripts.py:55
↓ 3 callers
Function
step
Generic step decorator. :param name: Step name as in the feature file. :param type_: Step type ("given", "when" or "then"). If None, this ste
src/pytest_bdd/steps.py:135
↓ 2 callers
Method
__init__
Compile regex.
src/pytest_bdd/parsers.py:36
↓ 2 callers
Method
_serialize_tags
Serialize item's tags. :param item: json-serialized `Scenario` or `Feature`. :return: `list` of `dict` in the form of: [
src/pytest_bdd/cucumber_json.py:74
↓ 2 callers
Method
add_step_report
Add new step report. :param step_report: New current step report. :type step_report: pytest_bdd.reporting.StepReport
src/pytest_bdd/reporting.py:93
↓ 2 callers
Function
generate_code
Generate test code for the given filenames.
src/pytest_bdd/generation.py:61
↓ 2 callers
Function
get_caller_module_locals
Get the caller module locals dictionary. We use sys._getframe instead of inspect.stack(0) because the latter is way slower, since it iterates ove
src/pytest_bdd/utils.py:36
↓ 2 callers
Function
get_caller_module_path
Get the caller module path. We use sys._getframe instead of inspect.stack(0) because the latter is way slower, since it iterates over all the
src/pytest_bdd/utils.py:45
↓ 2 callers
Function
get_feature
Get a feature by the filename. :param str base_path: Base feature directory. :param str filename: Filename of the feature file. :param st
src/pytest_bdd/feature.py:38
↓ 2 callers
Function
get_features
Get features for given paths. :param list paths: `list` of paths (file or dirs) :return: `list` of `Feature` objects.
src/pytest_bdd/feature.py:60
↓ 2 callers
Function
get_features_base_dir
(caller_module_path: str)
src/pytest_bdd/scenario.py:387
↓ 2 callers
Function
get_gherkin_document
(abs_filename: str, encoding: str = "utf-8")
src/pytest_bdd/gherkin_parser.py:311
↓ 2 callers
Function
get_line_partial_match_count
(pattern: str)
tests/feature/test_rule_example_format.py:111
↓ 2 callers
Function
get_python_name_generator
Generate a sequence of suitable python names out of given arbitrary string name.
src/pytest_bdd/scenario.py:423
↓ 2 callers
Function
get_required_args
Get a list of argument that are required for a function. :param func: The function to inspect. :return: A list of argument names.
src/pytest_bdd/utils.py:23
↓ 2 callers
Function
getfixturedefs
(fixturemanager: FixtureManager, fixturename: str, node: Node)
src/pytest_bdd/compat.py:17
↓ 2 callers
Function
group_steps
Group steps by type.
src/pytest_bdd/generation.py:155
↓ 2 callers
Function
inject_fixturedefs_for_step
Inject fixture definitions that can parse a step. We fist iterate over all the fixturedefs that can parse the step. Then we sort them by the
src/pytest_bdd/scenario.py:125
↓ 2 callers
Method
parse_background
(self, background_data: GherkinBackground)
src/pytest_bdd/parser.py:464
↓ 2 callers
Function
parse_feature_files
Parse feature files of given paths. :param paths: `list` of paths (file or dirs) :return: `list` of `tuple` in form: (`list` of
src/pytest_bdd/generation.py:138
↓ 2 callers
Function
parse_lines
(lines: list[str])
tests/feature/test_gherkin_terminal_reporter.py:48
↓ 2 callers
Method
parse_scenario
Parse a scenario data dictionary into a ScenarioTemplate object. Args: scenario_data (dict): The dictionary containing scenario d
src/pytest_bdd/parser.py:419
↓ 2 callers
Method
parse_steps
Parse a list of step data into Step objects. Args: steps_data (List[dict]): The list of step data. Returns:
src/pytest_bdd/parser.py:380
↓ 2 callers
Method
render
Render the scenario with the given context. Args: context (Mapping[str, Any]): The context for rendering steps. Returns:
src/pytest_bdd/parser.py:205
↓ 2 callers
Method
serialize
Serialize the step execution report. :return: Serialized step execution report. :rtype: dict
src/pytest_bdd/reporting.py:37
↓ 1 callers
Function
_execute_scenario
Execute the scenario. :param feature: Feature. :param scenario: Scenario. :param request: request.
src/pytest_bdd/scenario.py:252
↓ 1 callers
Function
_execute_step_function
Execute step function.
src/pytest_bdd/scenario.py:200
↓ 1 callers
Method
_extract_rule_background
Extract the first background from rule children if it exists.
src/pytest_bdd/parser.py:523
↓ 1 callers
Method
_extract_rule_scenarios
Yield each parsed scenario under a rule.
src/pytest_bdd/parser.py:530
↓ 1 callers
Function
_find_step_fixturedef
Find step fixturedef.
src/pytest_bdd/generation.py:129
↓ 1 callers
Method
_get_result
Get scenario test run result. :param step: `Step` step we get result for :param report: pytest `Report` object :return: `dict
src/pytest_bdd/cucumber_json.py:57
↓ 1 callers
Function
_get_scenario_decorator
( feature: Feature, feature_name: str, templated_scenario: ScenarioTemplate, scenario_name: str )
src/pytest_bdd/scenario.py:279
↓ 1 callers
Method
_parse_and_add_rule
Parse a rule, including its background and scenarios, and add to the feature.
src/pytest_bdd/parser.py:508
↓ 1 callers
Method
_parse_and_add_scenario
Parse an individual scenario and add it to the feature's scenarios.
src/pytest_bdd/parser.py:538
↓ 1 callers
Method
_parse_feature_file
Parse a feature file into a Feature object. Returns: Dict: A Gherkin document representation of the feature file.
src/pytest_bdd/parser.py:473
↓ 1 callers
Function
_to_raw_string
(normal_string: str)
src/pytest_bdd/gherkin_parser.py:307
↓ 1 callers
Function
add_bdd_ini
(parser: Parser)
src/pytest_bdd/plugin.py:66
↓ 1 callers
Method
add_example
Add a new example row. Args: values (Sequence[str]): The values for the example row.
src/pytest_bdd/parser.py:112
↓ 1 callers
Method
add_step
Add a step to the scenario. Args: step (Step): The step to add.
src/pytest_bdd/parser.py:176
↓ 1 callers
Method
as_contexts
Generate contexts for the examples. Yields: Dict[str, Any]: A dictionary mapping parameter names to their values for each example
src/pytest_bdd/parser.py:120
↓ 1 callers
Function
collect_example_parametrizations
( templated_scenario: ScenarioTemplate, )
src/pytest_bdd/scenario.py:328
↓ 1 callers
Method
fail
Stop collecting information and finalize the report as failed.
src/pytest_bdd/reporting.py:139
↓ 1 callers
Function
find_fixturedefs_for_step
Find the fixture defs that can parse a step.
src/pytest_bdd/scenario.py:53
↓ 1 callers
Function
find_unique_name
Find a unique name among a set of strings. New names are generated by appending an increasing number at the end of the name. Example: >>
src/pytest_bdd/steps.py:187
↓ 1 callers
Function
get_fixture_path
(fixture_def: FixtureDef)
src/pytest_bdd/scenario.py:141
↓ 1 callers
Function
get_from_ini
Get value from ini config. Return default if value has not been set. Use if the default value is dynamic. Otherwise, set default on addini call.
src/pytest_bdd/scenario.py:395
↓ 1 callers
Function
get_name
()
src/pytest_bdd/scenario.py:429
↓ 1 callers
Function
get_parser
(step_name: str)
src/pytest_bdd/parsers.py:107
↓ 1 callers
Function
get_step_function
Get the step function (context) for the given step. We first figure out what's the step fixture name that we have to inject. Then we let `pa
src/pytest_bdd/scenario.py:159
↓ 1 callers
Function
handle_gherkin_parser_error
Map the error message to a specific exception type and raise it.
src/pytest_bdd/gherkin_parser.py:330
↓ 1 callers
Function
inject_fixture
Inject fixture into pytest fixture request. :param request: pytest fixture request :param arg: argument name :param value: ar
src/pytest_bdd/compat.py:20
↓ 1 callers
Method
is_matching
Match given name with the step name.
src/pytest_bdd/parsers.py:51
↓ 1 callers
Function
iterparentnodeids
Return the parent node IDs of a given node ID, inclusive. For the node ID "testing/code/test_excinfo.py::TestFormattedExcinfo::test_repr
src/pytest_bdd/scenario.py:78
↓ 1 callers
Function
make_python_name
Make python attribute name out of a given string.
src/pytest_bdd/scenario.py:407
↓ 1 callers
Function
migrate_tests_in_file
Migrate all bdd-based tests in the given test file.
src/pytest_bdd/scripts.py:22
↓ 1 callers
Method
parse_arguments
Get step arguments. :return: `dict` of step arguments
src/pytest_bdd/parsers.py:41
↓ 1 callers
Function
parse_step_arguments
Parse step arguments.
src/pytest_bdd/scenario.py:179
↓ 1 callers
Function
print_missing_code
Print missing code with TerminalWriter.
src/pytest_bdd/generation.py:83
↓ 1 callers
Method
raw
(self)
src/pytest_bdd/gherkin_parser.py:134
↓ 1 callers
Method
render_datatable
Render the datatable with the given context, but avoid replacing text inside angle brackets if context is missing. Args:
src/pytest_bdd/parser.py:325
↓ 1 callers
Function
runandparse
Run tests in testdir and parse json output.
tests/feature/test_cucumber_json.py:14
↓ 1 callers
Method
set_param_names
Set the parameter names for the examples. Args: keys (Iterable[str]): The parameter names to set.
src/pytest_bdd/parser.py:104
↓ 1 callers
Function
show_missing_code
Wrap pytest session to show missing code.
src/pytest_bdd/generation.py:76
Function
_
Enter pytest's pdb trace.
src/pytest_bdd/plugin.py:39
Method
__bool__
Check if there are any examples. Returns: bool: True if there are examples, False otherwise.
src/pytest_bdd/parser.py:130
Method
__eq__
(self, other: object)
tests/feature/test_cucumber_json.py:29
Method
__eq__
(self, other: object)
tests/feature/test_report.py:15
Method
__init__
(self, message: str, line: int, line_content: str, filename: str)
src/pytest_bdd/exceptions.py:33
Method
__init__
Initialize a step. Args: name (str): The name of the step. type (str): The type of the step (e.g., 'given', 'when', '
src/pytest_bdd/parser.py:289
Method
__init__
(self, basedir: str, filename: str, encoding: str = "utf-8")
src/pytest_bdd/parser.py:375
Method
__init__
(self, config: Config)
src/pytest_bdd/gherkin_terminal_reporter.py:47
Method
__init__
(self, name: str)
src/pytest_bdd/parsers.py:16
Method
__init__
Compile parse expression.
src/pytest_bdd/parsers.py:59
Method
__init__
Compile parse expression.
src/pytest_bdd/parsers.py:82
Method
__init__
Step report constructor. :param pytest_bdd.parser.Step step: Step.
src/pytest_bdd/reporting.py:29
Method
__init__
Scenario report constructor. :param pytest_bdd.parser.Scenario scenario: Scenario.
src/pytest_bdd/reporting.py:76
Method
__init__
(self, logfile: str)
src/pytest_bdd/cucumber_json.py:52
Method
__init__
(self, type: type | None = None)
tests/feature/test_cucumber_json.py:26
Method
__init__
(self, type: Optional[type] = None)
tests/feature/test_report.py:12
Method
__str__
(self)
src/pytest_bdd/exceptions.py:40
Method
__str__
Return a string representation of the step. Returns: str: A string representation of the step.
src/pytest_bdd/parser.py:316
Function
_pytest_bdd_example
The current scenario outline parametrization. This is used internally by pytest_bdd. If no outline is used, we just return an empty dict to
src/pytest_bdd/plugin.py:45
Function
_scenario
()
src/pytest_bdd/scenario.py:469
Function
_show_missing_code_main
Preparing fixture duplicates for output.
src/pytest_bdd/generation.py:170
Function
add_options
Add pytest-bdd options.
src/pytest_bdd/generation.py:33
Function
add_options
(parser: Parser)
src/pytest_bdd/gherkin_terminal_reporter.py:15
Function
add_options
Add pytest-bdd options.
src/pytest_bdd/cucumber_json.py:20
Method
add_step
Add a step to the background. Args: step (Step): The step to add.
src/pytest_bdd/parser.py:356
Function
after_step
Finalize the step report as successful.
src/pytest_bdd/reporting.py:188
Method
all_background_steps
(self)
src/pytest_bdd/parser.py:186
Function
before_scenario
Create scenario report for the item.
src/pytest_bdd/reporting.py:159
Function
before_step
Store step start time.
src/pytest_bdd/reporting.py:177
next →
1–100 of 291, ranked by callers