Skip to content

Commit 7a1270c

Browse files
committed
simplify test
1 parent c0575ea commit 7a1270c

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

tests/integration/test_coverage.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,16 @@ def test_get_added_lines(
1515
git = subprocess_module.Git()
1616
relative_file_path = file_path.relative_to(integration_dir)
1717

18-
def _check_added_lines():
19-
added_lines = coverage.get_added_lines(git, "main")
18+
assert coverage.get_added_lines(git, "main") == {
19+
relative_file_path: list(range(7, 13)) # Line numbers start at 1
20+
}
2021

21-
assert added_lines == {
22-
relative_file_path: list(range(7, 13)) # Line numbers start at 1
23-
}
24-
25-
_check_added_lines()
2622
subprocess.check_call(["git", "switch", "main"], cwd=integration_dir)
2723
write_file("E", "F")
2824
commit()
2925
subprocess.check_call(["git", "push", "origin", "main"], cwd=integration_dir)
3026
subprocess.check_call(["git", "switch", "branch"], cwd=integration_dir)
3127

32-
_check_added_lines()
28+
assert coverage.get_added_lines(git, "main") == {
29+
relative_file_path: list(range(7, 13)) # Line numbers start at 1
30+
}

0 commit comments

Comments
 (0)