diff options
author | Hugo <hugovk@users.noreply.github.com> | 2018-03-18 21:33:18 +0200 |
---|---|---|
committer | Hugo <hugovk@users.noreply.github.com> | 2018-03-18 22:26:31 +0200 |
commit | ac4f7d34f8752ab78949efcaa9f0bd938df33622 (patch) | |
tree | 0c7acd1d3c1e0012d26d610c7a9fe81197e28a5e /git/test | |
parent | 14582df679a011e8c741eb5dcd8126f883e1bc71 (diff) | |
download | gitpython-ac4f7d34f8752ab78949efcaa9f0bd938df33622.tar.gz |
Rewrite unnecessary dict/list/tuple calls as literals
Diffstat (limited to 'git/test')
-rw-r--r-- | git/test/performance/test_odb.py | 4 | ||||
-rw-r--r-- | git/test/performance/test_streams.py | 2 | ||||
-rw-r--r-- | git/test/test_diff.py | 2 | ||||
-rw-r--r-- | git/test/test_index.py | 6 | ||||
-rw-r--r-- | git/test/test_refs.py | 2 | ||||
-rw-r--r-- | git/test/test_remote.py | 4 | ||||
-rw-r--r-- | git/test/test_tree.py | 2 |
7 files changed, 11 insertions, 11 deletions
diff --git a/git/test/performance/test_odb.py b/git/test/performance/test_odb.py index 425af84a..8bd614f2 100644 --- a/git/test/performance/test_odb.py +++ b/git/test/performance/test_odb.py @@ -28,11 +28,11 @@ class TestObjDBPerformance(TestBigRepoR): # GET TREES # walk all trees of all commits st = time() - blobs_per_commit = list() + blobs_per_commit = [] nt = 0 for commit in commits: tree = commit.tree - blobs = list() + blobs = [] for item in tree.traverse(): nt += 1 if item.type == 'blob': diff --git a/git/test/performance/test_streams.py b/git/test/performance/test_streams.py index 3909d8ff..2e3772a0 100644 --- a/git/test/performance/test_streams.py +++ b/git/test/performance/test_streams.py @@ -69,7 +69,7 @@ class TestObjDBPerformance(TestBigRepoR): # reading in chunks of 1 MiB cs = 512 * 1000 - chunks = list() + chunks = [] st = time() ostream = ldb.stream(binsha) while True: diff --git a/git/test/test_diff.py b/git/test/test_diff.py index 48a5a641..d21dde62 100644 --- a/git/test/test_diff.py +++ b/git/test/test_diff.py @@ -217,7 +217,7 @@ class TestDiff(TestBase): def test_diff_interface(self): # test a few variations of the main diff routine - assertion_map = dict() + assertion_map = {} for i, commit in enumerate(self.rorepo.iter_commits('0.1.6', max_count=2)): diff_item = commit if i % 2 == 0: diff --git a/git/test/test_index.py b/git/test/test_index.py index ec3c59df..56c7e795 100644 --- a/git/test/test_index.py +++ b/git/test/test_index.py @@ -97,7 +97,7 @@ class TestIndex(TestBase): def _reset_progress(self): # maps paths to the count of calls - self._fprogress_map = dict() + self._fprogress_map = {} def _assert_entries(self, entries): for entry in entries: @@ -141,7 +141,7 @@ class TestIndex(TestBase): if isinstance(tree, str): tree = self.rorepo.commit(tree).tree - blist = list() + blist = [] for blob in tree.traverse(predicate=lambda e, d: e.type == "blob", branch_first=False): assert (blob.path, 0) in index.entries blist.append(blob) @@ -527,7 +527,7 @@ class TestIndex(TestBase): # same index, no parents commit_message = "index without parents" - commit_no_parents = index.commit(commit_message, parent_commits=list(), head=True) + commit_no_parents = index.commit(commit_message, parent_commits=[], head=True) self.assertEqual(commit_no_parents.message, commit_message) self.assertEqual(len(commit_no_parents.parents), 0) self.assertEqual(cur_head.commit, commit_no_parents) diff --git a/git/test/test_refs.py b/git/test/test_refs.py index f885617e..348c3d48 100644 --- a/git/test/test_refs.py +++ b/git/test/test_refs.py @@ -45,7 +45,7 @@ class TestRefs(TestBase): TagReference(self.rorepo, "refs/invalid/tag", check_path=False) def test_tag_base(self): - tag_object_refs = list() + tag_object_refs = [] for tag in self.rorepo.tags: assert "refs/tags" in tag.path assert tag.name diff --git a/git/test/test_remote.py b/git/test/test_remote.py index 35924ca2..7c1711c2 100644 --- a/git/test/test_remote.py +++ b/git/test/test_remote.py @@ -44,8 +44,8 @@ class TestRemoteProgress(RemoteProgress): def __init__(self): super(TestRemoteProgress, self).__init__() - self._seen_lines = list() - self._stages_per_op = dict() + self._seen_lines = [] + self._stages_per_op = {} self._num_progress_messages = 0 def _parse_progress_line(self, line): diff --git a/git/test/test_tree.py b/git/test/test_tree.py index f3376e23..2b2ddb05 100644 --- a/git/test/test_tree.py +++ b/git/test/test_tree.py @@ -61,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 |