Skip to content

Commit 2929e5d

Browse files
committed
Ruff reformat
1 parent f07c21b commit 2929e5d

File tree

8 files changed

+13
-39
lines changed

8 files changed

+13
-39
lines changed

radish/examplescenario.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ class ExampleScenario(Scenario):
1111
"""
1212

1313
def __init__(self, id, keyword, sentence, path, line, parent, example, background=None):
14-
super().__init__(
15-
id, keyword, sentence, path, line, parent, parent.tags, background=background
16-
)
14+
super().__init__(id, keyword, sentence, path, line, parent, parent.tags, background=background)
1715
self.example = example
1816

1917
def has_to_run(self, scenario_choice):

radish/exceptions.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ class FeatureFileSyntaxError(RadishError, SyntaxError):
4545
Link: {docs_link}"""
4646

4747
def __init__(self, msg):
48-
super().__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

5351
class 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().__init__(
63-
"Cannot compile regex '{}' from step '{}': {}".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

6763
class 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().__init__(
77-
"Cannot compile pattern '{}' of step '{}': {}".format(pattern, step_func_name, error)
78-
)
72+
super().__init__("Cannot compile pattern '{}' of step '{}': {}".format(pattern, step_func_name, error))
7973

8074

8175
class 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().__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

10395
class StepDefinitionNotFoundError(RadishError):

radish/extensions/formatters/gherkin.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,7 @@ def console_writer_before_each_scenario(self, scenario):
172172
" # @{}{}\n".format(tag.name, "({})".format(tag.arg) if tag.arg else "")
173173
)
174174
else:
175-
output += colorful.cyan(
176-
" @{}{}\n".format(tag.name, "({})".format(tag.arg) if tag.arg else "")
177-
)
175+
output += colorful.cyan(" @{}{}\n".format(tag.name, "({})".format(tag.arg) if tag.arg else ""))
178176
output += " {}{}: {}".format(
179177
id_prefix,
180178
colorful.bold_white(scenario.keyword),
@@ -236,9 +234,7 @@ def _get_step_before_output(self, step, color_func=None):
236234
if step.text:
237235
id_padding = self.get_id_padding(len(step.parent.steps))
238236
output += colorful.bold_white('\n {}"""'.format(id_padding))
239-
output += colorful.cyan(
240-
"".join(["\n {}{}".format(id_padding, li) for li in step.raw_text])
241-
)
237+
output += colorful.cyan("".join(["\n {}{}".format(id_padding, li) for li in step.raw_text]))
242238
output += colorful.bold_white('\n {}"""'.format(id_padding))
243239

244240
if step.table_header:
@@ -300,9 +296,7 @@ def console_writer_after_each_step(self, step):
300296
if step.text:
301297
id_padding = self.get_id_padding(len(step.parent.steps))
302298
output += colorful.bold_white('\n {}"""'.format(id_padding))
303-
output += colorful.cyan(
304-
"".join(["\n {}{}".format(id_padding, li) for li in step.raw_text])
305-
)
299+
output += colorful.cyan("".join(["\n {}{}".format(id_padding, li) for li in step.raw_text]))
306300
output += colorful.bold_white('\n {}"""'.format(id_padding))
307301

308302
if step.table_header:

radish/iterationscenario.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ class IterationScenario(Scenario):
1111
"""
1212

1313
def __init__(self, id, keyword, sentence, path, line, parent, iteration, background=None):
14-
super().__init__(
15-
id, keyword, sentence, path, line, parent, parent.tags, background=background
16-
)
14+
super().__init__(id, keyword, sentence, path, line, parent, parent.tags, background=background)
1715
self.iteration = iteration
1816

1917
def has_to_run(self, scenario_choice):

radish/scenariooutline.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ def __init__(
3838
preconditions=None,
3939
background=None,
4040
):
41-
super().__init__(
42-
id, keyword, sentence, path, line, parent, tags, preconditions, background
43-
)
41+
super().__init__(id, keyword, sentence, path, line, parent, tags, preconditions, background)
4442
self.example_keyword = example_keyword
4543
self.scenarios = []
4644
self.examples_header = []

radish/stepregistry.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ def _extract_regex(func):
6161
"""
6262
docstr = func.__doc__.strip() if func.__doc__ else None
6363
if not docstr:
64-
raise RadishError(
65-
"Step definition '{}' from class must have step regex in docstring".format(func.__name__)
66-
)
64+
raise RadishError("Step definition '{}' from class must have step regex in docstring".format(func.__name__))
6765

6866
regex = docstr.splitlines()[0]
6967
try:

tests/exploratory/custom_types/radish/quoted_string_steps.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,4 @@ def capitalize_string(step):
1313

1414
@then("I expect the string to be {:QuotedString}")
1515
def expect_string(step, expected_string):
16-
assert step.context.string == expected_string, 'Expected "{}" got "{}"'.format(
17-
expected_string, step.context.string
18-
)
16+
assert step.context.string == expected_string, 'Expected "{}" got "{}"'.format(expected_string, step.context.string)

tests/radish/steps.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ def expect_sum(step, expected_sum):
7474
def expect_diff(step, expected_diff):
7575
"Then I expect the difference to be <n>"
7676
assert step.context.difference == expected_diff, (
77-
"The expected difference {} does not match actual difference {}".format(
78-
expected_diff, step.context.difference
79-
)
77+
"The expected difference {} does not match actual difference {}".format(expected_diff, step.context.difference)
8078
)
8179

8280

0 commit comments

Comments
 (0)