summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo <hugovk@users.noreply.github.com>2018-03-18 21:43:41 +0200
committerHugo <hugovk@users.noreply.github.com>2018-03-18 22:26:31 +0200
commit87a644184b05e99a4809de378f21424ef6ced06e (patch)
tree8179e2a309fc9765544d6b95e85485fdfc322ef7
parent34cce402e23a21ba9c3fdf5cd7f27a85e65245c2 (diff)
downloadgitpython-87a644184b05e99a4809de378f21424ef6ced06e.tar.gz
Unnecessary generator - rewrite as a list comprehension
-rw-r--r--git/test/test_index.py4
-rw-r--r--git/test/test_tree.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/git/test/test_index.py b/git/test/test_index.py
index 56c7e795..04638c57 100644
--- a/git/test/test_index.py
+++ b/git/test/test_index.py
@@ -127,7 +127,7 @@ class TestIndex(TestBase):
# test stage
index_merge = IndexFile(self.rorepo, fixture_path("index_merge"))
self.assertEqual(len(index_merge.entries), 106)
- assert len(list(e for e in index_merge.entries.values() if e.stage != 0))
+ assert len([e for e in index_merge.entries.values() if e.stage != 0])
# write the data - it must match the original
tmpfile = tempfile.mktemp()
@@ -190,7 +190,7 @@ class TestIndex(TestBase):
# merge three trees - here we have a merge conflict
three_way_index = IndexFile.from_tree(rw_repo, common_ancestor_sha, cur_sha, other_sha)
- assert len(list(e for e in three_way_index.entries.values() if e.stage != 0))
+ assert len([e for e in three_way_index.entries.values() if e.stage != 0])
# ITERATE BLOBS
merge_required = lambda t: t[0] != 0
diff --git a/git/test/test_tree.py b/git/test/test_tree.py
index 2b2ddb05..3005722f 100644
--- a/git/test/test_tree.py
+++ b/git/test/test_tree.py
@@ -79,7 +79,7 @@ class TestTree(TestBase):
# only choose trees
trees_only = lambda i, d: i.type == "tree"
trees = list(root.traverse(predicate=trees_only))
- assert len(trees) == len(list(i for i in root.traverse() if trees_only(i, 0)))
+ assert len(trees) == len([i for i in root.traverse() if trees_only(i, 0)])
# test prune
lib_folder = lambda t, d: t.path == "lib"