Skip to content

Commit 27714c2

Browse files
committed
Some ruff fixes
1 parent 16442a2 commit 27714c2

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

test/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
GIT2CPP_TEST_WASM = os.getenv("GIT2CPP_TEST_WASM") == "1"
88

99
if GIT2CPP_TEST_WASM:
10-
from .conftest_wasm import *
10+
from .conftest_wasm import * # noqa: F403
1111

1212

1313
# Fixture to run test in current tmp_path

test/conftest_wasm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def pytest_ignore_collect(collection_path: pathlib.Path) -> bool:
1515
return collection_path.name not in [
1616
"test_add.py",
1717
"test_branch.py",
18-
"test_checkout.py"
18+
"test_checkout.py",
1919
"test_clone.py",
2020
"test_commit.py",
2121
"test_config.py",

test/test_diff.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -404,9 +404,9 @@ def test_diff_inter_hunk_context(
404404
# Count hunks in small context output
405405
hunk_count_small = len(
406406
[
407-
l
408-
for l in p_small.stdout.split("\n")
409-
if l.startswith("@@") and l.endswith("@@")
407+
line
408+
for line in p_small.stdout.split("\n")
409+
if line.startswith("@@") and line.endswith("@@")
410410
]
411411
)
412412

@@ -421,9 +421,9 @@ def test_diff_inter_hunk_context(
421421
# Count hunks in large context output
422422
hunk_count_large = len(
423423
[
424-
l
425-
for l in p_large.stdout.split("\n")
426-
if l.startswith("@@") and l.endswith("@@")
424+
line
425+
for line in p_large.stdout.split("\n")
426+
if line.startswith("@@") and line.endswith("@@")
427427
]
428428
)
429429

test/test_log.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,11 @@ def test_log_commit_without_references(commit_env_config, git2cpp_path, tmp_path
276276

277277
# First commit line should have references
278278
lines = p_log.stdout.split("\n")
279-
first_commit_line = [l for l in lines if l.startswith("commit")][0]
279+
first_commit_line = [line for line in lines if line.startswith("commit")][0]
280280
assert "(" in first_commit_line # Has references
281281

282282
# Second commit (older one) should not have empty parentheses
283-
second_commit_line = [l for l in lines if l.startswith("commit")][1]
283+
second_commit_line = [line for line in lines if line.startswith("commit")][1]
284284
# Should either have no parentheses or have actual references
285285
if "(" in second_commit_line:
286286
# If it has parentheses, they shouldn't be empty

test/test_revlist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def test_revlist(repo_init_with_commit, commit_env_config, git2cpp_path, tmp_pat
1919
p = subprocess.run(cmd, capture_output=True, cwd=tmp_path, text=True)
2020
assert p.returncode == 0
2121

22-
lines = [l for l in p.stdout.splitlines() if l.strip()]
22+
lines = [line for line in p.stdout.splitlines() if line.strip()]
2323
assert len(lines) == 2
2424
assert all(len(oid) == 40 for oid in lines)
2525
assert lines[0] != lines[1]

0 commit comments

Comments
 (0)