Skip to content

Commit 685ae2a

Browse files
committed
Linting tests.
1 parent c71c302 commit 685ae2a

File tree

9 files changed

+221
-204
lines changed

9 files changed

+221
-204
lines changed

tests/discover_demo_module/submodule_b.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
from string import ascii_letters
44

55

6-
class Bob():
6+
class Bob:
77
pass
88

99

10-
class Alice():
10+
class Alice:
1111
pass

tests/test_import_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def raises_attribute_error(obj, **kwargs):
8989
raises_attribute_error({1, 2, 3}, id="set"),
9090
raises_attribute_error({"a": 1, "b": 2, "c": 3}, id="dictionary"),
9191
pytest.param(HasPath, haspath_error, id="HasPath"),
92-
]
92+
],
9393
)
9494
def test_discover_errors(obj, expects):
9595
with expects:

tests/test_pagesizes/test_pagesizes.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,25 @@
4545
[
4646
(
4747
Size_inch(12, 34),
48-
"Size_inch(width=<Unit '12.000 inch': 864.000pt>, height=<Unit '34.000 inch': 2448.000pt>)"
48+
"Size_inch(width=<Unit '12.000 inch': 864.000pt>, height=<Unit '34.000 inch': 2448.000pt>)",
4949
),
5050
(
5151
Size_cm(12, 34),
52-
"Size_cm(width=<Unit '12.000 cm': 340.157pt>, height=<Unit '34.000 cm': 963.780pt>)"
52+
"Size_cm(width=<Unit '12.000 cm': 340.157pt>, height=<Unit '34.000 cm': 963.780pt>)",
5353
),
5454
(
5555
Size_mm(12, 34),
56-
"Size_mm(width=<Unit '12.000 mm': 34.016pt>, height=<Unit '34.000 mm': 96.378pt>)"
56+
"Size_mm(width=<Unit '12.000 mm': 34.016pt>, height=<Unit '34.000 mm': 96.378pt>)",
5757
),
5858
(
5959
Size_um(12, 34),
60-
"Size_um(width=<Unit '12.000 µm': 0.034pt>, height=<Unit '34.000 µm': 0.096pt>)"
60+
"Size_um(width=<Unit '12.000 µm': 0.034pt>, height=<Unit '34.000 µm': 0.096pt>)",
6161
),
6262
(
6363
Size_pica(12, 34),
64-
"Size_pica(width=<Unit '12.000 pc': 144.000pt>, height=<Unit '34.000 pc': 408.000pt>)"
64+
"Size_pica(width=<Unit '12.000 pc': 144.000pt>, height=<Unit '34.000 pc': 408.000pt>)",
6565
),
66-
]
66+
],
6767
)
6868
def test_repr(obj, expects):
6969
assert repr(obj) == expects
@@ -76,7 +76,7 @@ def test_repr(obj, expects):
7676
(Size_cm(12, 34), "Size_cm(width=12, height=34)"),
7777
(Size_um(12, 34), "Size_um(width=12, height=34)"),
7878
(Size_pica(12, 34), "Size_pica(width=12, height=34)"),
79-
]
79+
],
8080
)
8181
def test_str(obj, expects):
8282
assert str(obj) == expects
@@ -174,17 +174,18 @@ def test_convert_size(unit):
174174
([1, 5], um, (0.00283464566929, 0.00283464566929 * 5)),
175175
([1, 5], pc, (12, 12 * 5)),
176176
pytest.param(2, 5, 10, id="not isinstance(from_, Unit)"),
177-
]
177+
],
178178
)
179179
def test_convert_from(value, unit, expects):
180180
assert convert_from(value, unit) == expects
181181

182182

183183
@pytest.mark.parametrize(
184-
"size, expected, class_", [
184+
"size, expected, class_",
185+
[
185186
((12, 34), PageSize(12, 34), PageSize),
186187
((12, 34), Size_mm(12, 34), Size_mm),
187-
]
188+
],
188189
)
189190
def test_from_size(size, expected, class_):
190191
print(class_.from_size(size))
@@ -207,7 +208,7 @@ def test_from_size(size, expected, class_):
207208
("12", [("12", '')]),
208209
('', []),
209210
("10μm", [("10", "μm")]),
210-
]
211+
],
211212
)
212213
def test_measurement_re(string, expects):
213214
assert _measurement_re.findall(string) == expects
@@ -258,7 +259,7 @@ def test_parse_measurement_errors():
258259
("12.34 mm", 12.34 * mm),
259260
("5inch", 5 * inch),
260261
("5in", 5 * inch),
261-
]
262+
],
262263
)
263264
def test_parse_measurement(string, expects):
264265
assert parse_measurement(string) == expects

0 commit comments

Comments
 (0)