summaryrefslogtreecommitdiff
path: root/git/test/performance/test_streams.py
diff options
context:
space:
mode:
authorKostis Anagnostopoulos <ankostis@gmail.com>2016-10-15 13:11:16 +0200
committerKostis Anagnostopoulos <ankostis@gmail.com>2016-10-16 02:46:31 +0200
commit0210e394e0776d0b7097bf666bebd690ed0c0e4f (patch)
treee74014dd49c93f75b8cf388d700b681a321d261b /git/test/performance/test_streams.py
parenta2d248bb8362808121f6b6abfd316d83b65afa79 (diff)
downloadgitpython-0210e394e0776d0b7097bf666bebd690ed0c0e4f.tar.gz
src: import os.path as osp
Diffstat (limited to 'git/test/performance/test_streams.py')
-rw-r--r--git/test/performance/test_streams.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/git/test/performance/test_streams.py b/git/test/performance/test_streams.py
index 42cbade5..699aa25b 100644
--- a/git/test/performance/test_streams.py
+++ b/git/test/performance/test_streams.py
@@ -1,26 +1,27 @@
"""Performance data streaming performance"""
from __future__ import print_function
-from time import time
import os
-import sys
import subprocess
+import sys
+from time import time
from git.test.lib import (
with_rw_repo
)
-from gitdb.util import bin_to_hex
+from gitdb import (
+ LooseObjectDB,
+ IStream
+)
from gitdb.test.lib import make_memory_file
+from gitdb.util import bin_to_hex
+
+import os.path as osp
from .lib import (
TestBigRepoR
)
-from gitdb import (
- LooseObjectDB,
- IStream
-)
-
class TestObjDBPerformance(TestBigRepoR):
@@ -31,7 +32,7 @@ class TestObjDBPerformance(TestBigRepoR):
def test_large_data_streaming(self, rwrepo):
# TODO: This part overlaps with the same file in gitdb.test.performance.test_stream
# It should be shared if possible
- ldb = LooseObjectDB(os.path.join(rwrepo.git_dir, 'objects'))
+ ldb = LooseObjectDB(osp.join(rwrepo.git_dir, 'objects'))
for randomize in range(2):
desc = (randomize and 'random ') or ''
@@ -47,7 +48,7 @@ class TestObjDBPerformance(TestBigRepoR):
elapsed_add = time() - st
assert ldb.has_object(binsha)
db_file = ldb.readable_db_object_path(bin_to_hex(binsha))
- fsize_kib = os.path.getsize(db_file) / 1000
+ fsize_kib = osp.getsize(db_file) / 1000
size_kib = size / 1000
msg = "Added %i KiB (filesize = %i KiB) of %s data to loose odb in %f s ( %f Write KiB / s)"
@@ -109,7 +110,7 @@ class TestObjDBPerformance(TestBigRepoR):
assert gitsha == bin_to_hex(binsha) # we do it the same way, right ?
# as its the same sha, we reuse our path
- fsize_kib = os.path.getsize(db_file) / 1000
+ fsize_kib = osp.getsize(db_file) / 1000
msg = "Added %i KiB (filesize = %i KiB) of %s data to using git-hash-object in %f s ( %f Write KiB / s)"
msg %= (size_kib, fsize_kib, desc, gelapsed_add, size_kib / gelapsed_add)
print(msg, file=sys.stderr)