File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -109,9 +109,6 @@ class Rule:
109
109
tags : set [str ]
110
110
background : Background | None = None
111
111
112
- def add_background (self , background : Background ) -> None :
113
- self .background = background
114
-
115
112
116
113
@dataclass (eq = False )
117
114
class ScenarioTemplate :
@@ -492,19 +489,16 @@ def parse(self) -> Feature:
492
489
493
490
def _parse_and_add_rule (self , rule_data : GherkinRule , feature : Feature ) -> None :
494
491
"""Parse a rule, including its background and scenarios, and add to the feature."""
492
+ background = self ._extract_rule_background (rule_data )
493
+
495
494
rule = Rule (
496
495
keyword = rule_data .keyword ,
497
496
name = rule_data .name ,
498
497
description = rule_data .description ,
499
498
tags = self .get_tag_names (rule_data .tags ),
499
+ background = background ,
500
500
)
501
501
502
- # Add background if present within the rule
503
- background = self ._extract_rule_background (rule_data )
504
- if background :
505
- rule .add_background (background )
506
-
507
- # Parse and add scenarios under the rule
508
502
for scenario in self ._extract_rule_scenarios (rule_data , feature , rule ):
509
503
feature .scenarios [scenario .name ] = scenario
510
504
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ def serialize(self) -> dict[str, Any]:
130
130
"keyword" : scenario .rule .keyword ,
131
131
"name" : scenario .rule .name ,
132
132
"description" : scenario .rule .description ,
133
- "tags" : sorted ( scenario .rule .tags ) ,
133
+ "tags" : scenario .rule .tags ,
134
134
}
135
135
136
136
return serialized
You can’t perform that action at this time.
0 commit comments