summaryrefslogtreecommitdiff
path: root/gitdb/test/performance/lib.py
diff options
context:
space:
mode:
Diffstat (limited to 'gitdb/test/performance/lib.py')
-rw-r--r--gitdb/test/performance/lib.py31
1 files changed, 12 insertions, 19 deletions
diff --git a/gitdb/test/performance/lib.py b/gitdb/test/performance/lib.py
index 3563fcf..ec45cf3 100644
--- a/gitdb/test/performance/lib.py
+++ b/gitdb/test/performance/lib.py
@@ -4,9 +4,8 @@
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
"""Contains library functions"""
import os
-from gitdb.test.lib import *
-import shutil
-import tempfile
+import logging
+from gitdb.test.lib import TestBase
#{ Invvariants
@@ -14,17 +13,6 @@ k_env_git_repo = "GITDB_TEST_GIT_REPO_BASE"
#} END invariants
-#{ Utilities
-def resolve_or_fail(env_var):
- """:return: resolved environment variable or raise EnvironmentError"""
- try:
- return os.environ[env_var]
- except KeyError:
- raise EnvironmentError("Please set the %r envrionment variable and retry" % env_var)
- # END exception handling
-
-#} END utilities
-
#{ Base Classes
@@ -41,14 +29,19 @@ class TestBigRepoR(TestBase):
head_sha_50 = '32347c375250fd470973a5d76185cac718955fd5'
#} END invariants
- @classmethod
- def setUpAll(cls):
+ def setUp(self):
try:
- super(TestBigRepoR, cls).setUpAll()
+ super(TestBigRepoR, self).setUp()
except AttributeError:
pass
- cls.gitrepopath = resolve_or_fail(k_env_git_repo)
- assert cls.gitrepopath.endswith('.git')
+
+ self.gitrepopath = os.environ.get(k_env_git_repo)
+ if not self.gitrepopath:
+ logging.info("You can set the %s environment variable to a .git repository of your choice - defaulting to the gitdb repository")
+ ospd = os.path.dirname
+ self.gitrepopath = os.path.join(ospd(ospd(ospd(ospd(__file__)))), '.git')
+ # end assure gitrepo is set
+ assert self.gitrepopath.endswith('.git')
#} END base classes