Skip to content

Commit 99b2ad3

Browse files
committed
Ruff
1 parent fc1489d commit 99b2ad3

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

.ruff.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ ignore = [
3030
]
3131

3232
[lint.per-file-ignores]
33+
"test/sample-default-supressed.py" = [
34+
"N999", # invalid module name
35+
]
3336
"test/sample-directive-opts.py" = [
3437
"N999", # invalid module name
3538
]

test/sample-default-supressed.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33

44
def get_parser():
5-
parser = ArgumentParser(prog='sample-default-suppressed', description='Test suppression of version default')
6-
parser.add_argument('--version', help='print version number', action='version', version='1.2.3')
5+
parser = ArgumentParser(
6+
prog='sample-default-suppressed', description='Test suppression of version default'
7+
)
8+
parser.add_argument(
9+
'--version', help='print version number', action='version', version='1.2.3'
10+
)
711
return parser

test/test_default_html.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,17 @@ def get_text(node):
3131
if be_found:
3232
if any(rex.search(get_text(node)) for node in nodes):
3333
return
34-
msg = (f'{check!r} not found in any node matching path {path} in {fname}: '
35-
f'{[node.text for node in nodes]!r}')
34+
msg = (
35+
f'{check!r} not found in any node matching path {path} in {fname}: '
36+
f'{[node.text for node in nodes]!r}'
37+
)
3638
else:
3739
if all(not rex.search(get_text(node)) for node in nodes):
3840
return
39-
msg = (f'Found {check!r} in a node matching path {path} in {fname}: '
40-
f'{[node.text for node in nodes]!r}')
41+
msg = (
42+
f'Found {check!r} in a node matching path {path} in {fname}: '
43+
f'{[node.text for node in nodes]!r}'
44+
)
4145

4246
raise AssertionError(msg)
4347

@@ -85,10 +89,10 @@ def get_text(node):
8589
(
8690
'default-suppressed.html',
8791
[
88-
(".//h1", 'Sample', False),
89-
(".//h1", 'Default suppressed'),
90-
(".//h2", 'Named Arguments'),
91-
(".//section/dl/dd/p", 'Default', False),
92+
('.//h1', 'Sample', False),
93+
('.//h1', 'Default suppressed'),
94+
('.//h2', 'Named Arguments'),
95+
('.//section/dl/dd/p', 'Default', False),
9296
],
9397
),
9498
],

0 commit comments

Comments
 (0)