summaryrefslogtreecommitdiff
path: root/git/test/test_tree.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2018-03-24 13:45:17 +0100
committerGitHub <noreply@github.com>2018-03-24 13:45:17 +0100
commitf3265bd8beb017890699d093586126ff8af4a3fe (patch)
treeccf02df66dbb979c7f6da6949456902a06aa1b1e /git/test/test_tree.py
parent9f12b26b81a8e7667b2a26a7878e5bc033610ed5 (diff)
parent80b038f8d8c7c67c148ebd7a5f7a0cb39541b761 (diff)
downloadgitpython-f3265bd8beb017890699d093586126ff8af4a3fe.tar.gz
Merge pull request #737 from hugovk/rm-2.6
Drop support for EOL Python 2.6 and 3.3
Diffstat (limited to 'git/test/test_tree.py')
-rw-r--r--git/test/test_tree.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/git/test/test_tree.py b/git/test/test_tree.py
index 5fd4d760..dc23f29c 100644
--- a/git/test/test_tree.py
+++ b/git/test/test_tree.py
@@ -6,10 +6,7 @@
from io import BytesIO
import sys
-try:
- from unittest import skipIf
-except ImportError:
- from unittest2 import skipIf
+from unittest import skipIf
from git import (
Tree,
@@ -64,7 +61,7 @@ class TestTree(TestBase):
def test_traverse(self):
root = self.rorepo.tree('0.1.6')
num_recursive = 0
- all_items = list()
+ all_items = []
for obj in root.traverse():
if "/" in obj.path:
num_recursive += 1
@@ -82,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"
@@ -91,7 +88,7 @@ class TestTree(TestBase):
# trees and blobs
assert len(set(trees) | set(root.trees)) == len(trees)
- assert len(set(b for b in root if isinstance(b, Blob)) | set(root.blobs)) == len(root.blobs)
+ assert len({b for b in root if isinstance(b, Blob)} | set(root.blobs)) == len(root.blobs)
subitem = trees[0][0]
assert "/" in subitem.path
assert subitem.name == osp.basename(subitem.path)