MCPcopy Create free account
hub / github.com/pytest-dev/pytest-bdd / generate_code

Function generate_code

src/pytest_bdd/generation.py:61–73  ·  view source on GitHub ↗

Generate test code for the given filenames.

(features: list[Feature], scenarios: list[ScenarioTemplate], steps: list[Step])

Source from the content-addressed store, hash-verified

59
60
61def generate_code(features: list[Feature], scenarios: list[ScenarioTemplate], steps: list[Step]) -> str:
62 """Generate test code for the given filenames."""
63 grouped_steps = group_steps(steps)
64 template = template_lookup.get_template("test.py.mak")
65 code = template.render(
66 features=features,
67 scenarios=scenarios,
68 steps=grouped_steps,
69 make_python_name=make_python_name,
70 make_python_docstring=make_python_docstring,
71 make_string_literal=make_string_literal,
72 )
73 return cast(str, code)
74
75
76def show_missing_code(config: Config) -> int:

Callers 2

print_generated_codeFunction · 0.85
print_missing_codeFunction · 0.85

Calls 2

group_stepsFunction · 0.85
renderMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…