Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 87a6441

Browse filesBrowse files
committed
Unnecessary generator - rewrite as a list comprehension
1 parent 34cce40 commit 87a6441
Copy full SHA for 87a6441

2 files changed

+3-3Lines changed: 3 additions & 3 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎git/test/test_index.py‎

Copy file name to clipboardExpand all lines: git/test/test_index.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def test_index_file_base(self):
127127
# test stage
128128
index_merge = IndexFile(self.rorepo, fixture_path("index_merge"))
129129
self.assertEqual(len(index_merge.entries), 106)
130-
assert len(list(e for e in index_merge.entries.values() if e.stage != 0))
130+
assert len([e for e in index_merge.entries.values() if e.stage != 0])
131131

132132
# write the data - it must match the original
133133
tmpfile = tempfile.mktemp()
@@ -190,7 +190,7 @@ def test_index_file_from_tree(self, rw_repo):
190190

191191
# merge three trees - here we have a merge conflict
192192
three_way_index = IndexFile.from_tree(rw_repo, common_ancestor_sha, cur_sha, other_sha)
193-
assert len(list(e for e in three_way_index.entries.values() if e.stage != 0))
193+
assert len([e for e in three_way_index.entries.values() if e.stage != 0])
194194

195195
# ITERATE BLOBS
196196
merge_required = lambda t: t[0] != 0
Collapse file

‎git/test/test_tree.py‎

Copy file name to clipboardExpand all lines: git/test/test_tree.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def test_traverse(self):
7979
# only choose trees
8080
trees_only = lambda i, d: i.type == "tree"
8181
trees = list(root.traverse(predicate=trees_only))
82-
assert len(trees) == len(list(i for i in root.traverse() if trees_only(i, 0)))
82+
assert len(trees) == len([i for i in root.traverse() if trees_only(i, 0)])
8383

8484
# test prune
8585
lib_folder = lambda t, d: t.path == "lib"

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.