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

Method __init__

src/pytest_bdd/parser.py:289–314  ·  view source on GitHub ↗

Initialize a step. Args: name (str): The name of the step. type (str): The type of the step (e.g., 'given', 'when', 'then'). indent (int): The indentation level of the step. line_number (int): The line number where the step starts in the file.

(
        self,
        name: str,
        type: str,
        indent: int,
        line_number: int,
        keyword: str,
        datatable: DataTable | None = None,
        docstring: str | None = None,
    )

Source from the content-addressed store, hash-verified

287 background: Background | None = field(init=False, default=None)
288
289 def __init__(
290 self,
291 name: str,
292 type: str,
293 indent: int,
294 line_number: int,
295 keyword: str,
296 datatable: DataTable | None = None,
297 docstring: str | None = None,
298 ) -> None:
299 """Initialize a step.
300
301 Args:
302 name (str): The name of the step.
303 type (str): The type of the step (e.g., 'given', 'when', 'then').
304 indent (int): The indentation level of the step.
305 line_number (int): The line number where the step starts in the file.
306 keyword (str): The keyword used for the step (e.g., 'Given', 'When', 'Then').
307 """
308 self.name = name
309 self.type = type
310 self.indent = indent
311 self.line_number = line_number
312 self.keyword = keyword
313 self.datatable = datatable
314 self.docstring = docstring
315
316 def __str__(self) -> str:
317 """Return a string representation of the step.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected