summaryrefslogtreecommitdiff
path: root/git/test/performance/lib.py
diff options
context:
space:
mode:
authorKonrad Weihmann <kweihmann@outlook.com>2020-07-10 18:41:02 +0200
committerKonrad Weihmann <kweihmann@outlook.com>2020-07-12 15:01:21 +0200
commit0374d7cf84ecd8182b74a639fcfdb9eafddcfd15 (patch)
treef462fb9fc434f197b39213b53f33f4e09fc0329e /git/test/performance/lib.py
parent9cb7ae8d9721e1269f5bacd6dbc33ecdec4659c0 (diff)
downloadgitpython-0374d7cf84ecd8182b74a639fcfdb9eafddcfd15.tar.gz
tests: move to root dir
This should ensure that tests are NOT packaged into release package by setuptools, as tests are development only + fixtures after moving Signed-off-by: Konrad Weihmann <kweihmann@outlook.com>
Diffstat (limited to 'git/test/performance/lib.py')
-rw-r--r--git/test/performance/lib.py94
1 files changed, 0 insertions, 94 deletions
diff --git a/git/test/performance/lib.py b/git/test/performance/lib.py
deleted file mode 100644
index 7edffa78..00000000
--- a/git/test/performance/lib.py
+++ /dev/null
@@ -1,94 +0,0 @@
-"""Contains library functions"""
-import logging
-import os
-import tempfile
-
-from git import (
- Repo
-)
-from git.db import (
- GitCmdObjectDB,
- GitDB
-)
-from git.test.lib import (
- TestBase
-)
-from git.util import rmtree
-import os.path as osp
-
-#{ Invariants
-
-k_env_git_repo = "GIT_PYTHON_TEST_GIT_REPO_BASE"
-
-#} END invariants
-
-
-#{ Base Classes
-
-class TestBigRepoR(TestBase):
-
- """TestCase providing access to readonly 'big' repositories using the following
- member variables:
-
- * gitrorepo
-
- * Read-Only git repository - actually the repo of git itself
-
- * puregitrorepo
-
- * As gitrepo, but uses pure python implementation
- """
-
- #{ Invariants
- #} END invariants
-
- def setUp(self):
- try:
- super(TestBigRepoR, self).setUp()
- except AttributeError:
- pass
-
- 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) +
- "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.puregitrorepo = Repo(repo_path, odbt=GitDB, search_parent_directories=True)
-
- def tearDown(self):
- self.gitrorepo.git.clear_cache()
- self.gitrorepo = None
- self.puregitrorepo.git.clear_cache()
- self.puregitrorepo = None
-
-
-class TestBigRepoRW(TestBigRepoR):
-
- """As above, but provides a big repository that we can write to.
-
- Provides ``self.gitrwrepo`` and ``self.puregitrwrepo``"""
-
- def setUp(self):
- self.gitrwrepo = None
- try:
- super(TestBigRepoRW, self).setUp()
- except AttributeError:
- pass
- dirname = tempfile.mktemp()
- os.mkdir(dirname)
- self.gitrwrepo = self.gitrorepo.clone(dirname, shared=True, bare=True, odbt=GitCmdObjectDB)
- self.puregitrwrepo = Repo(dirname, odbt=GitDB)
-
- def tearDown(self):
- super(TestBigRepoRW, self).tearDown()
- if self.gitrwrepo is not None:
- rmtree(self.gitrwrepo.working_dir)
- self.gitrwrepo.git.clear_cache()
- self.gitrwrepo = None
- self.puregitrwrepo.git.clear_cache()
- self.puregitrwrepo = None
-
-#} END base classes