Skip to content

Commit 37e6c28

Browse files
committed
Lint
1 parent 3427373 commit 37e6c28

File tree

2 files changed

+22
-18
lines changed

2 files changed

+22
-18
lines changed

tests/test_flake8_dunder_all.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
pytest.param(testing_source_h, set(), id="from import"),
6464
pytest.param(testing_source_i, {"1:0: DALL000 Module lacks __all__."}, id="lots of lines"),
6565
pytest.param(testing_source_j, {"1:0: DALL000 Module lacks __all__."}, id="multiline import"),
66-
]
66+
],
6767
)
6868
def test_plugin(source: str, expects: Set[str]):
6969
assert results(source) == expects
@@ -132,7 +132,7 @@ def test_plugin(source: str, expects: Set[str]):
132132
set(),
133133
id="UPPER_right_order_2",
134134
),
135-
]
135+
],
136136
)
137137
def test_plugin_alphabetical(source: str, expects: Set[str], dunder_all_alphabetical: AlphabeticalOptions):
138138
plugin = Plugin(ast.parse(source))
@@ -203,7 +203,7 @@ def test_plugin_alphabetical(source: str, expects: Set[str], dunder_all_alphabet
203203
set(),
204204
id="UPPER_right_order_2",
205205
),
206-
]
206+
],
207207
)
208208
def test_plugin_alphabetical_ann_assign(
209209
source: str,
@@ -226,7 +226,7 @@ def test_plugin_alphabetical_ann_assign(
226226
pytest.param("__all__ = abc", AlphabeticalOptions.LOWER, id="LOWER_abc"),
227227
pytest.param("__all__ = abc", AlphabeticalOptions.NONE, id="NONE_abc"),
228228
pytest.param("__all__ = abc", AlphabeticalOptions.UPPER, id="UPPER_abc"),
229-
]
229+
],
230230
)
231231
def test_plugin_alphabetical_not_list(source: str, dunder_all_alphabetical: AlphabeticalOptions):
232232
plugin = Plugin(ast.parse(source))
@@ -276,7 +276,7 @@ def test_plugin_alphabetical_tuple():
276276
pytest.param(testing_source_j, ["a_function"], False, 2, id="multiline import"),
277277
pytest.param(testing_source_m, ["a_function"], False, 7, id="if False"),
278278
pytest.param(if_type_checking_source, ["a_function"], False, 5, id="if TYPE_CHECKING:"),
279-
]
279+
],
280280
)
281281
def test_visitor(source: str, members: List[str], found_all: bool, last_import: int):
282282
visitor = Visitor()
@@ -332,7 +332,7 @@ def test_visitor(source: str, members: List[str], found_all: bool, last_import:
332332
10,
333333
id="if TYPE_CHECKING try finally",
334334
),
335-
]
335+
],
336336
)
337337
def test_visitor_endlineno(source: str, members: List[str], found_all: bool, last_import: int):
338338
visitor = Visitor(True)
@@ -372,7 +372,7 @@ def test_visitor_endlineno(source: str, members: List[str], found_all: bool, las
372372
pytest.param(if_type_checking_try_source, [], 1, id="if TYPE_CHECKING try"),
373373
pytest.param(if_type_checking_try_finally_source, [], 1, id="if TYPE_CHECKING try finally"),
374374
pytest.param(not_type_checking_if_source, [], 1, id="not TYPE_CHECKING if"),
375-
]
375+
],
376376
)
377377
def test_check_and_add_all(
378378
tmp_pathplus: PathPlus,
@@ -420,7 +420,7 @@ def test_check_and_add_all(
420420
pytest.param(testing_source_l, [], 0, id="typing.overload"),
421421
pytest.param(testing_source_m, [], 1, id="if False"),
422422
pytest.param(testing_source_n, [], 1, id="if TYPE_CHECKING"),
423-
]
423+
],
424424
)
425425
def test_check_and_add_all_tuples(
426426
tmp_pathplus: PathPlus,
@@ -455,7 +455,7 @@ def test_check_and_add_all_tuples(
455455
pytest.param(testing_source_i, [], 1, id="lots of lines"),
456456
pytest.param(testing_source_m, [], 1, id="if False"),
457457
pytest.param(testing_source_n, [], 1, id="if TYPE_CHECKING"),
458-
]
458+
],
459459
)
460460
def test_check_and_add_all_single_quotes(tmp_pathplus: PathPlus, source: str, members: List[str], ret: int):
461461
tmpfile = tmp_pathplus / "source.py"
@@ -468,9 +468,12 @@ def test_check_and_add_all_single_quotes(tmp_pathplus: PathPlus, source: str, me
468468
assert f"__all__ = [{members_string}]" in tmpfile.read_text()
469469

470470

471-
@pytest.mark.parametrize("source, members", [
472-
pytest.param(mangled_source, [], id="mangled"),
473-
])
471+
@pytest.mark.parametrize(
472+
"source, members",
473+
[
474+
pytest.param(mangled_source, [], id="mangled"),
475+
],
476+
)
474477
def test_check_and_add_all_mangled(tmp_pathplus: PathPlus, capsys, source: str, members: List[str]):
475478
tmpfile = tmp_pathplus / "source.py"
476479
tmpfile.write_text(source)

tests/test_main.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
id="async function no __all__ and noqa",
5656
),
5757
pytest.param(f" # noqa \n{testing_source_g}", ["a_function"], 1, id="async function no __all__"),
58-
]
58+
],
5959
)
6060
def test_main(tmp_pathplus: PathPlus, source: str, members: List[str], ret: int):
6161
tmpfile = tmp_pathplus / "source.py"
@@ -84,7 +84,7 @@ def test_main(tmp_pathplus: PathPlus, source: str, members: List[str], ret: int)
8484
pytest.param(testing_source_i, [], 1, id="lots of lines"),
8585
pytest.param(testing_source_k, [], 0, id="overload"),
8686
pytest.param(testing_source_l, [], 0, id="typing.overload"),
87-
]
87+
],
8888
)
8989
def test_main_single_quotes(capsys, tmp_pathplus: PathPlus, source: str, members: List[str], ret: int):
9090
tmpfile = tmp_pathplus / "source.py"
@@ -127,7 +127,7 @@ def test_main_single_quotes(capsys, tmp_pathplus: PathPlus, source: str, members
127127
pytest.param(testing_source_i, [], 1, id="lots of lines"),
128128
pytest.param(testing_source_k, [], 0, id="overload"),
129129
pytest.param(testing_source_l, [], 0, id="typing.overload"),
130-
]
130+
],
131131
)
132132
def test_main_tuples(tmp_pathplus: PathPlus, source: str, members: List[str], ret: int):
133133
tmpfile = tmp_pathplus / "source.py"
@@ -144,9 +144,10 @@ def test_main_tuples(tmp_pathplus: PathPlus, source: str, members: List[str], re
144144
assert result.stdout == f"Checking {tmpfile}\n"
145145

146146

147-
@pytest.mark.parametrize("source, members", [
148-
pytest.param(mangled_source, [], id="mangled"),
149-
])
147+
@pytest.mark.parametrize(
148+
"source, members",
149+
[pytest.param(mangled_source, [], id="mangled")],
150+
)
150151
def test_main_mangled(tmp_pathplus: PathPlus, capsys, source: str, members: List[str]):
151152
tmpfile = tmp_pathplus / "source.py"
152153
tmpfile.write_text(source)

0 commit comments

Comments
 (0)