Skip to content

Commit e7b5326

Browse files
committed
Forgot to go back and implement the templated bool
1 parent 240ac6d commit e7b5326

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/pytest_bdd/parser.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ class Background:
295295
steps: list[Step] = field(init=False, default_factory=list)
296296

297297
def add_step(self, step: Step) -> None:
298-
"""Add a step to the background.
298+
"""Add a step to txhe background.
299299
300300
Args:
301301
step (Step): The step to add.
@@ -385,18 +385,19 @@ def parse_scenario(self, scenario_data: dict, feature: Feature) -> ScenarioTempl
385385
Returns:
386386
ScenarioTemplate: A ScenarioTemplate object representing the parsed scenario.
387387
"""
388+
templated = "examples" in scenario_data
388389
scenario = ScenarioTemplate(
389390
feature=feature,
390391
name=strip_comments(scenario_data["name"]),
391392
line_number=scenario_data["location"]["line"],
392-
templated=False,
393+
templated=templated,
393394
tags=self.get_tag_names(scenario_data["tags"]),
394395
description=textwrap.dedent(scenario_data.get("description", "")),
395396
)
396397
for step in self.parse_steps(scenario_data["steps"]):
397398
scenario.add_step(step)
398399

399-
if "examples" in scenario_data:
400+
if templated:
400401
for example_data in scenario_data["examples"]:
401402
examples = Examples(
402403
line_number=example_data["location"]["line"],

0 commit comments

Comments
 (0)