2929class AllureListener :
3030 def __init__ (self , behave_config ):
3131 self .behave_config = behave_config
32- self .issue_pattern = behave_config .userdata .get (' AllureFormatter.issue_pattern' , None )
33- self .link_pattern = behave_config .userdata .get (' AllureFormatter.link_pattern' , None )
34- self .hide_excluded = behave_config .userdata .get (' AllureFormatter.hide_excluded' , False )
32+ self .issue_pattern = behave_config .userdata .get (" AllureFormatter.issue_pattern" , None )
33+ self .link_pattern = behave_config .userdata .get (" AllureFormatter.link_pattern" , None )
34+ self .hide_excluded = behave_config .userdata .get (" AllureFormatter.hide_excluded" , False )
3535 self .logger = AllureReporter ()
3636 self .current_step_uuid = None
3737 self .current_scenario_uuid = None
@@ -70,7 +70,7 @@ def stop_feature(self):
7070
7171 @allure_commons .hookimpl
7272 def start_test (self , parent_uuid , uuid , name , parameters , context ):
73- self .start_scenario (context [' scenario' ])
73+ self .start_scenario (context [" scenario" ])
7474
7575 def start_scenario (self , scenario ):
7676 self .current_scenario_uuid = uuid4 ()
@@ -82,7 +82,7 @@ def start_scenario(self, scenario):
8282 test_case .titlePath = get_title_path (scenario )
8383 test_case .historyId = scenario_history_id (scenario )
8484 test_case .testCaseId = md5 (test_case .fullName )
85- test_case .description = ' \n ' .join (scenario .description )
85+ test_case .description = " \n " .join (scenario .description )
8686 test_case .parameters = scenario_parameters (scenario )
8787
8888 test_case .links .extend (scenario_links (
@@ -91,20 +91,20 @@ def start_scenario(self, scenario):
9191 link_pattern = self .link_pattern ))
9292 test_case .labels .extend (scenario_labels (scenario ))
9393 test_case .labels .append (Label (name = LabelType .FEATURE , value = scenario .feature .name ))
94- test_case .labels .append (Label (name = LabelType .FRAMEWORK , value = ' behave' ))
94+ test_case .labels .append (Label (name = LabelType .FRAMEWORK , value = " behave" ))
9595 test_case .labels .append (Label (name = LabelType .LANGUAGE , value = platform_label ()))
9696
9797 self .logger .schedule_test (self .current_scenario_uuid , test_case )
9898
9999 @allure_commons .hookimpl
100100 def stop_test (self , parent_uuid , uuid , name , context , exc_type , exc_val , exc_tb ):
101- self .stop_scenario (context [' scenario' ])
101+ self .stop_scenario (context [" scenario" ])
102102
103103 def stop_scenario (self , scenario ):
104104 tag_expression = self .__get_tag_expression (self .behave_config )
105105 should_run = scenario .should_run_with_tags (tag_expression )
106106 should_run = should_run and scenario .should_run_with_name_select (self .behave_config )
107- should_drop_skipped_by_option = scenario .status == ' skipped' and not self .behave_config .show_skipped
107+ should_drop_skipped_by_option = scenario .status == " skipped" and not self .behave_config .show_skipped
108108 should_drop_excluded = self .hide_excluded and (scenario .skip_reason == TEST_PLAN_SKIP_REASON or not should_run )
109109
110110 if should_drop_skipped_by_option or should_drop_excluded :
@@ -135,16 +135,16 @@ def match_step(self, match):
135135 def start_behave_step (self , step ):
136136
137137 self .current_step_uuid = uuid4 ()
138- name = f' { step .keyword } { step .name } '
138+ name = f" { step .keyword } { step .name } "
139139
140140 allure_step = TestStepResult (name = name , start = now ())
141141 self .logger .start_step (None , self .current_step_uuid , allure_step )
142142
143143 if step .text :
144- self .logger .attach_data (uuid4 (), step .text , name = ' .text' , attachment_type = AttachmentType .TEXT )
144+ self .logger .attach_data (uuid4 (), step .text , name = " .text" , attachment_type = AttachmentType .TEXT )
145145
146146 if step .table :
147- self .logger .attach_data (uuid4 (), step_table (step ), name = ' .table' , attachment_type = AttachmentType .CSV )
147+ self .logger .attach_data (uuid4 (), step_table (step ), name = " .table" , attachment_type = AttachmentType .CSV )
148148
149149 def stop_behave_step (self , result ):
150150 status = step_status (result )
@@ -194,7 +194,7 @@ def add_description_html(self, test_description_html):
194194 def add_link (self , url , link_type , name ):
195195 test_result = self .logger .get_test (None )
196196 if test_result :
197- pattern = '{}'
197+ pattern = "{}"
198198 if link_type == LinkType .ISSUE and self .issue_pattern :
199199 pattern = self .issue_pattern
200200 elif link_type == LinkType .LINK and self .link_pattern :
@@ -230,7 +230,7 @@ def enter(self):
230230 self ._logger .start_group (group .uuid , group )
231231 self ._groups .append (group )
232232
233- def exit (self ): # noqa: A003
233+ def exit (self ):
234234 group = self ._groups .pop ()
235235 if group .befores or group .afters :
236236 self ._logger .stop_group (group .uuid )
0 commit comments