@@ -18,7 +18,7 @@ class LanguageNotSupportedError(RadishError):
1818
1919 def __init__ (self , language ):
2020 self .language = language
21- super (LanguageNotSupportedError , self ).__init__ ("Language {0 } could not be found" .format (language ))
21+ super ().__init__ ("Language {} could not be found" .format (language ))
2222
2323
2424class FeatureFileNotFoundError (RadishError ):
@@ -28,7 +28,7 @@ class FeatureFileNotFoundError(RadishError):
2828
2929 def __init__ (self , featurefile ):
3030 self .featurefile = featurefile
31- super (FeatureFileNotFoundError , self ).__init__ ("Feature file '{0 }': No such file" .format (featurefile ))
31+ super ().__init__ ("Feature file '{}': No such file" .format (featurefile ))
3232
3333
3434class FeatureFileSyntaxError (RadishError , SyntaxError ):
@@ -45,9 +45,7 @@ class FeatureFileSyntaxError(RadishError, SyntaxError):
4545Link: {docs_link}"""
4646
4747 def __init__ (self , msg ):
48- super (FeatureFileSyntaxError , self ).__init__ (
49- FeatureFileSyntaxError .MESSAGE_TEMPLATE .format (msg = msg , docs_link = __DOCS__ )
50- )
48+ super ().__init__ (FeatureFileSyntaxError .MESSAGE_TEMPLATE .format (msg = msg , docs_link = __DOCS__ ))
5149
5250
5351class StepRegexError (RadishError , SyntaxError ):
@@ -59,9 +57,7 @@ def __init__(self, regex, step_func_name, re_error):
5957 self .regex = regex
6058 self .step_func_name = step_func_name
6159 self .re_error = re_error
62- super (StepRegexError , self ).__init__ (
63- "Cannot compile regex '{0}' from step '{1}': {2}" .format (regex , step_func_name , re_error )
64- )
60+ super ().__init__ ("Cannot compile regex '{}' from step '{}': {}" .format (regex , step_func_name , re_error ))
6561
6662
6763class StepPatternError (RadishError , SyntaxError ):
@@ -73,9 +69,7 @@ def __init__(self, pattern, step_func_name, error):
7369 self .pattern = pattern
7470 self .step_func_name = step_func_name
7571 self .error = error
76- super (StepPatternError , self ).__init__ (
77- "Cannot compile pattern '{0}' of step '{1}': {2}" .format (pattern , step_func_name , error )
78- )
72+ super ().__init__ ("Cannot compile pattern '{}' of step '{}': {}" .format (pattern , step_func_name , error ))
7973
8074
8175class SameStepError (RadishError ):
@@ -95,9 +89,7 @@ def __init__(self, regex, func1, func2):
9589 self .regex = regex
9690 self .func1 = func1
9791 self .func2 = func2
98- super (SameStepError , self ).__init__ (
99- SameStepError .MESSAGE_TEMPLATE .format (func2 .__name__ , regex , func1 .__name__ )
100- )
92+ super ().__init__ (SameStepError .MESSAGE_TEMPLATE .format (func2 .__name__ , regex , func1 .__name__ ))
10193
10294
10395class StepDefinitionNotFoundError (RadishError ):
@@ -118,7 +110,7 @@ def my_step(step):
118110
119111 def __init__ (self , step ):
120112 self .step = step
121- super (StepDefinitionNotFoundError , self ).__init__ (
113+ super ().__init__ (
122114 StepDefinitionNotFoundError .MESSAGE_TEMPLATE .format (
123115 sentence = step .sentence ,
124116 step_path = step .path ,
@@ -144,8 +136,8 @@ class HookError(RadishError):
144136 def __init__ (self , hook_function , failure ):
145137 self .hook_function = hook_function
146138 self .failure = failure
147- super (HookError , self ).__init__ (
148- "Hook '{0 }' from {1 }:{2 } raised: '{3 }: {4 }'" .format (
139+ super ().__init__ (
140+ "Hook '{}' from {}:{} raised: '{}: {}'" .format (
149141 hook_function .__name__ ,
150142 hook_function .__code__ .co_filename ,
151143 hook_function .__code__ .co_firstlineno ,
@@ -163,8 +155,8 @@ class ScenarioNotFoundError(RadishError):
163155 def __init__ (self , scenario_id , amount_of_scenarios ):
164156 self .scenario_id = scenario_id
165157 self .amount_of_scenarios = amount_of_scenarios
166- super (ScenarioNotFoundError , self ).__init__ (
167- "No scenario with id {0 } found. Specify a scenario id between 1 and {1 }" .format (
158+ super ().__init__ (
159+ "No scenario with id {} found. Specify a scenario id between 1 and {}" .format (
168160 scenario_id , amount_of_scenarios
169161 )
170162 )
0 commit comments