Skip to content

Commit df84238

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 3b9bf7a commit df84238

1 file changed

Lines changed: 12 additions & 24 deletions

File tree

tests/test_config_and_args.py

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,11 @@ def test_200_options(capsys: pytest.CaptureFixture[str]):
166166

167167
@pytest.mark.skipif(flake8 is None, reason="flake8 is not installed")
168168
def test_anyio_from_config(tmp_path: Path, capsys: pytest.CaptureFixture[str]):
169-
assert tmp_path.joinpath(".flake8").write_text(
170-
"""
169+
assert tmp_path.joinpath(".flake8").write_text("""
171170
[flake8]
172171
anyio = True
173172
select = ASYNC220
174-
"""
175-
)
173+
""")
176174

177175
from flake8_async.visitors.visitor2xx import Visitor22X # noqa: PLC0415
178176

@@ -210,24 +208,20 @@ def test_anyio_from_config(tmp_path: Path, capsys: pytest.CaptureFixture[str]):
210208

211209
# `code` parameter temporarily introduced to test deprecation of trio200-blocking-calls
212210
def _test_async200_from_config_common(tmp_path: Path, code: str = "async200") -> str:
213-
assert tmp_path.joinpath(".flake8").write_text(
214-
f"""
211+
assert tmp_path.joinpath(".flake8").write_text(f"""
215212
[flake8]
216213
{code}-blocking-calls =
217214
other -> async,
218215
sync_fns.* -> the_async_equivalent,
219216
select = ASYNC200
220217
extend-ignore = E
221-
"""
222-
)
223-
assert tmp_path.joinpath("example.py").write_text(
224-
"""
218+
""")
219+
assert tmp_path.joinpath("example.py").write_text("""
225220
import sync_fns
226221
227222
async def foo():
228223
sync_fns.takes_a_long_time()
229-
"""
230-
)
224+
""")
231225
return (
232226
"./example.py:5:5: ASYNC200 User-configured blocking sync call sync_fns.* "
233227
"in async function, consider replacing with the_async_equivalent.\n"
@@ -506,13 +500,11 @@ def test_disable_noqa_ast(
506500
@pytest.mark.skipif(flake8 is None, reason="flake8 is not installed")
507501
def test_config_select_error_code(tmp_path: Path) -> None:
508502
# this ... seems to work? I'm confused
509-
assert tmp_path.joinpath(".flake8").write_text(
510-
"""
503+
assert tmp_path.joinpath(".flake8").write_text("""
511504
[flake8]
512505
select = ASYNC100
513506
extend-select = ASYNC100
514-
"""
515-
)
507+
""")
516508
res = subprocess.run(
517509
["flake8", "--help"], cwd=tmp_path, capture_output=True, check=False
518510
)
@@ -523,12 +515,10 @@ def test_config_select_error_code(tmp_path: Path) -> None:
523515
# flake8>=6 enforces three-letter error codes in config
524516
@pytest.mark.skipif(flake8 is None, reason="flake8 is not installed")
525517
def test_config_ignore_error_code(tmp_path: Path) -> None:
526-
assert tmp_path.joinpath(".flake8").write_text(
527-
"""
518+
assert tmp_path.joinpath(".flake8").write_text("""
528519
[flake8]
529520
ignore = ASYNC100
530-
"""
531-
)
521+
""")
532522
res = subprocess.run(
533523
["flake8", "--help"],
534524
cwd=tmp_path,
@@ -545,12 +535,10 @@ def test_config_ignore_error_code(tmp_path: Path) -> None:
545535
# flake8>=6 enforces three-letter error codes in config
546536
@pytest.mark.skipif(flake8 is None, reason="flake8 is not installed")
547537
def test_config_extend_ignore_error_code(tmp_path: Path) -> None:
548-
assert tmp_path.joinpath(".flake8").write_text(
549-
"""
538+
assert tmp_path.joinpath(".flake8").write_text("""
550539
[flake8]
551540
extend-ignore = ASYNC100
552-
"""
553-
)
541+
""")
554542
res = subprocess.run(
555543
["flake8", "--help"],
556544
cwd=tmp_path,

0 commit comments

Comments
 (0)