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

Class Background

src/pytest_bdd/parser.py:345–363  ·  view source on GitHub ↗

Represents the background steps for a feature. Attributes: line_number (int): The line number where the background starts in the file. steps (List[Step]): The list of steps in the background.

Source from the content-addressed store, hash-verified

343
344@dataclass(eq=False)
345class Background:
346 """Represents the background steps for a feature.
347
348 Attributes:
349 line_number (int): The line number where the background starts in the file.
350 steps (List[Step]): The list of steps in the background.
351 """
352
353 line_number: int
354 steps: list[Step] = field(init=False, default_factory=list)
355
356 def add_step(self, step: Step) -> None:
357 """Add a step to the background.
358
359 Args:
360 step (Step): The step to add.
361 """
362 step.background = self
363 self.steps.append(step)
364
365
366class FeatureParser:

Callers 1

parse_backgroundMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…