summaryrefslogtreecommitdiff
path: root/test/performance
diff options
context:
space:
mode:
authorSebastian Thiel <sebastian.thiel@icloud.com>2022-05-18 08:01:38 +0800
committerSebastian Thiel <sebastian.thiel@icloud.com>2022-05-18 08:01:38 +0800
commite530544546b2a4e5f00e8d9458bf1b895573ec41 (patch)
tree9b957bd812fe98664d3f1f75615dda8242663097 /test/performance
parentf78fc42b90711c81e06699d1ebdbe69e6648b949 (diff)
downloadgitpython-e530544546b2a4e5f00e8d9458bf1b895573ec41.tar.gz
reformat according to 'black' configuration file.
Diffstat (limited to 'test/performance')
-rw-r--r--test/performance/lib.py13
-rw-r--r--test/performance/test_commit.py9
-rw-r--r--test/performance/test_odb.py17
-rw-r--r--test/performance/test_streams.py4
4 files changed, 14 insertions, 29 deletions
diff --git a/test/performance/lib.py b/test/performance/lib.py
index 101e2cd4..c793d771 100644
--- a/test/performance/lib.py
+++ b/test/performance/lib.py
@@ -45,17 +45,12 @@ class TestBigRepoR(TestBase):
repo_path = os.environ.get(k_env_git_repo)
if repo_path is None:
logging.info(
- (
- "You can set the %s environment variable to a .git repository of"
- % k_env_git_repo
- )
+ ("You can set the %s environment variable to a .git repository of" % k_env_git_repo)
+ "your choice - defaulting to the gitpython repository"
)
repo_path = osp.dirname(__file__)
# end set some repo path
- self.gitrorepo = Repo(
- repo_path, odbt=GitCmdObjectDB, search_parent_directories=True
- )
+ self.gitrorepo = Repo(repo_path, odbt=GitCmdObjectDB, search_parent_directories=True)
self.puregitrorepo = Repo(repo_path, odbt=GitDB, search_parent_directories=True)
def tearDown(self):
@@ -79,9 +74,7 @@ class TestBigRepoRW(TestBigRepoR):
pass
dirname = tempfile.mktemp()
os.mkdir(dirname)
- self.gitrwrepo = self.gitrorepo.clone(
- dirname, shared=True, bare=True, odbt=GitCmdObjectDB
- )
+ self.gitrwrepo = self.gitrorepo.clone(dirname, shared=True, bare=True, odbt=GitCmdObjectDB)
self.puregitrwrepo = Repo(dirname, odbt=GitDB)
def tearDown(self):
diff --git a/test/performance/test_commit.py b/test/performance/test_commit.py
index 25cc34b8..38b529af 100644
--- a/test/performance/test_commit.py
+++ b/test/performance/test_commit.py
@@ -66,8 +66,7 @@ class TestPerformance(TestBigRepoRW, TestCommitSerialization):
# END for each traversed commit
elapsed_time = time() - st
print(
- "Traversed %i Commits in %s [s] ( %f commits/s )"
- % (nc, elapsed_time, nc / elapsed_time),
+ "Traversed %i Commits in %s [s] ( %f commits/s )" % (nc, elapsed_time, nc / elapsed_time),
file=sys.stderr,
)
@@ -81,8 +80,7 @@ class TestPerformance(TestBigRepoRW, TestCommitSerialization):
# END for each traversed commit
elapsed_time = time() - st
print(
- "Iterated %i Commits in %s [s] ( %f commits/s )"
- % (nc, elapsed_time, nc / elapsed_time),
+ "Iterated %i Commits in %s [s] ( %f commits/s )" % (nc, elapsed_time, nc / elapsed_time),
file=sys.stderr,
)
@@ -123,7 +121,6 @@ class TestPerformance(TestBigRepoRW, TestCommitSerialization):
elapsed = time() - st
print(
- "Serialized %i commits to loose objects in %f s ( %f commits / s )"
- % (nc, elapsed, nc / elapsed),
+ "Serialized %i commits to loose objects in %f s ( %f commits / s )" % (nc, elapsed, nc / elapsed),
file=sys.stderr,
)
diff --git a/test/performance/test_odb.py b/test/performance/test_odb.py
index 680464c9..4208c418 100644
--- a/test/performance/test_odb.py
+++ b/test/performance/test_odb.py
@@ -63,16 +63,13 @@ class TestObjDBPerformance(TestBigRepoR):
# END for each bloblist
elapsed = time() - st
- msg = (
- "%s: Retrieved %i blob (%i KiB) and their data in %g s ( %f blobs / s, %f KiB / s )"
- % (
- type(repo.odb),
- nb,
- data_bytes / 1000,
- elapsed,
- nb / elapsed,
- (data_bytes / 1000) / elapsed,
- )
+ msg = "%s: Retrieved %i blob (%i KiB) and their data in %g s ( %f blobs / s, %f KiB / s )" % (
+ type(repo.odb),
+ nb,
+ data_bytes / 1000,
+ elapsed,
+ nb / elapsed,
+ (data_bytes / 1000) / elapsed,
)
print(msg, file=sys.stderr)
results[2].append(elapsed)
diff --git a/test/performance/test_streams.py b/test/performance/test_streams.py
index 2ae94e29..5588212e 100644
--- a/test/performance/test_streams.py
+++ b/test/performance/test_streams.py
@@ -97,9 +97,7 @@ class TestObjDBPerformance(TestBigRepoR):
# VS. CGIT
##########
# CGIT ! Can using the cgit programs be faster ?
- proc = rwrepo.git.hash_object(
- "-w", "--stdin", as_process=True, istream=subprocess.PIPE
- )
+ proc = rwrepo.git.hash_object("-w", "--stdin", as_process=True, istream=subprocess.PIPE)
# write file - pump everything in at once to be a fast as possible
data = stream.getvalue() # cache it