@@ -46,7 +46,7 @@ def get_tag_names(tag_data: list[GherkinTag]) -> set[str]:
46
46
"""Extract tag names from tag data.
47
47
48
48
Args:
49
- tag_data (List [dict]): The tag data to extract names from.
49
+ tag_data (list [dict]): The tag data to extract names from.
50
50
51
51
Returns:
52
52
set[str]: A set of tag names.
@@ -64,7 +64,7 @@ class Feature:
64
64
rel_filename (str): The relative path of the feature file.
65
65
name (str): The name of the feature.
66
66
tags (set[str]): A set of tags associated with the feature.
67
- background (Optional[ Background] ): The background steps for the feature, if any.
67
+ background (Background | None ): The background steps for the feature, if any.
68
68
line_number (int): The line number where the feature starts in the file.
69
69
description (str): The description of the feature.
70
70
"""
@@ -86,10 +86,10 @@ class Examples:
86
86
"""Represents examples used in scenarios for parameterization.
87
87
88
88
Attributes:
89
- line_number (Optional[ int] ): The line number where the examples start.
90
- name (Optional[ str] ): The name of the examples.
91
- example_params (List [str]): The names of the parameters for the examples.
92
- examples (List [Sequence[str]]): The list of example rows.
89
+ line_number (int | None ): The line number where the examples start.
90
+ name (str | None ): The name of the examples.
91
+ example_params (list [str]): The names of the parameters for the examples.
92
+ examples (list [Sequence[str]]): The list of example rows.
93
93
"""
94
94
95
95
line_number : int | None = None
@@ -152,11 +152,11 @@ class ScenarioTemplate:
152
152
name (str): The name of the scenario.
153
153
line_number (int): The line number where the scenario starts in the file.
154
154
templated (bool): Whether the scenario is templated.
155
- description (Optional[ str] ): The description of the scenario.
155
+ description (str | None ): The description of the scenario.
156
156
tags (set[str]): A set of tags associated with the scenario.
157
- _steps (List [Step]): The list of steps in the scenario (internal use only).
158
- examples (Optional[ Examples] ): The examples used for parameterization in the scenario.
159
- rule (Optional[ Rule] ): The rule to which the scenario may belong (None = no rule).
157
+ _steps (list [Step]): The list of steps in the scenario (internal use only).
158
+ examples (Examples | None ): The examples used for parameterization in the scenario.
159
+ rule (Rule | None ): The rule to which the scenario may belong (None = no rule).
160
160
"""
161
161
162
162
feature : Feature
@@ -195,7 +195,7 @@ def steps(self) -> list[Step]:
195
195
"""Get all steps for the scenario, including background steps.
196
196
197
197
Returns:
198
- List [Step]: A list of steps, including any background steps from the feature.
198
+ list [Step]: A list of steps, including any background steps from the feature.
199
199
"""
200
200
return self .all_background_steps + self ._steps
201
201
@@ -242,8 +242,8 @@ class Scenario:
242
242
keyword (str): The keyword used to define the scenario.
243
243
name (str): The name of the scenario.
244
244
line_number (int): The line number where the scenario starts in the file.
245
- steps (List [Step]): The list of steps in the scenario.
246
- description (Optional[ str] ): The description of the scenario.
245
+ steps (list [Step]): The list of steps in the scenario.
246
+ description (str | None ): The description of the scenario.
247
247
tags (set[str]): A set of tags associated with the scenario.
248
248
"""
249
249
@@ -268,8 +268,8 @@ class Step:
268
268
indent (int): The indentation level of the step.
269
269
keyword (str): The keyword used for the step (e.g., 'Given', 'When', 'Then').
270
270
failed (bool): Whether the step has failed (internal use only).
271
- scenario (Optional[ ScenarioTemplate] ): The scenario to which this step belongs (internal use only).
272
- background (Optional[ Background] ): The background to which this step belongs (internal use only).
271
+ scenario (ScenarioTemplate | None ): The scenario to which this step belongs (internal use only).
272
+ background (Background | None ): The background to which this step belongs (internal use only).
273
273
"""
274
274
275
275
type : str
@@ -344,7 +344,7 @@ class Background:
344
344
345
345
Attributes:
346
346
line_number (int): The line number where the background starts in the file.
347
- steps (List [Step]): The list of steps in the background.
347
+ steps (list [Step]): The list of steps in the background.
348
348
"""
349
349
350
350
line_number : int
@@ -378,10 +378,10 @@ def parse_steps(self, steps_data: list[GherkinStep]) -> list[Step]:
378
378
"""Parse a list of step data into Step objects.
379
379
380
380
Args:
381
- steps_data (List [dict]): The list of step data.
381
+ steps_data (list [dict]): The list of step data.
382
382
383
383
Returns:
384
- List [Step]: A list of Step objects.
384
+ list [Step]: A list of Step objects.
385
385
"""
386
386
387
387
if not steps_data :
@@ -421,7 +421,7 @@ def parse_scenario(
421
421
Args:
422
422
scenario_data (dict): The dictionary containing scenario data.
423
423
feature (Feature): The feature to which this scenario belongs.
424
- rule (Optional[ Rule] ): The rule to which this scenario may belong. (None = no rule)
424
+ rule (Rule | None ): The rule to which this scenario may belong. (None = no rule)
425
425
426
426
Returns:
427
427
ScenarioTemplate: A ScenarioTemplate object representing the parsed scenario.
0 commit comments