From 56f21b2e9a5023cfcdd0e7bc5416409a28c29239 Mon Sep 17 00:00:00 2001 From: "Marcus R. Brown" Date: Thu, 10 Jan 2013 23:12:24 -0700 Subject: [PATCH 1/2] Fix tests that are broken under Python 2.7. --- git/test/lib/helper.py | 2 +- git/test/performance/lib.py | 8 ++++---- git/test/test_git.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/git/test/lib/helper.py b/git/test/lib/helper.py index 3a60d116c..5790a8589 100644 --- a/git/test/lib/helper.py +++ b/git/test/lib/helper.py @@ -227,7 +227,7 @@ class TestBase(TestCase): """ @classmethod - def setUpAll(cls): + def setUpClass(cls): """ Dynamically add a read-only repository to our actual type. This way each test type has its own repository diff --git a/git/test/performance/lib.py b/git/test/performance/lib.py index d0727b600..83a2c3980 100644 --- a/git/test/performance/lib.py +++ b/git/test/performance/lib.py @@ -51,8 +51,8 @@ class TestBigRepoR(TestBase): #} END invariants @classmethod - def setUpAll(cls): - super(TestBigRepoR, cls).setUpAll() + def setUpClass(cls): + super(TestBigRepoR, cls).setUpClass() repo_path = resolve_or_fail(k_env_git_repo) cls.gitrorepo = Repo(repo_path, odbt=GitCmdObjectDB) cls.puregitrorepo = Repo(repo_path, odbt=GitDB) @@ -64,8 +64,8 @@ class TestBigRepoRW(TestBigRepoR): Provides ``self.gitrwrepo`` and ``self.puregitrwrepo``""" @classmethod - def setUpAll(cls): - super(TestBigRepoRW, cls).setUpAll() + def setUpClass(cls): + super(TestBigRepoRW, cls).setUpClass() dirname = tempfile.mktemp() os.mkdir(dirname) cls.gitrwrepo = cls.gitrorepo.clone(dirname, shared=True, bare=True, odbt=GitCmdObjectDB) diff --git a/git/test/test_git.py b/git/test/test_git.py index 2d38e0a80..2ec1d89ba 100644 --- a/git/test/test_git.py +++ b/git/test/test_git.py @@ -19,8 +19,8 @@ class TestGit(TestBase): @classmethod - def setUpAll(cls): - super(TestGit, cls).setUpAll() + def setUpClass(cls): + super(TestGit, cls).setUpClass() cls.git = Git(cls.rorepo.working_dir) @patch_object(Git, 'execute') From e1f1b4edd9d4fcb48dcae5d2fc7df1dfa6ef7ba7 Mon Sep 17 00:00:00 2001 From: "Marcus R. Brown" Date: Fri, 11 Jan 2013 01:36:25 -0700 Subject: [PATCH 2/2] Rename tearDownAll to tearDownClass() for Python 2.7 compatibility. --- git/test/performance/lib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git/test/performance/lib.py b/git/test/performance/lib.py index 83a2c3980..a8acb9fde 100644 --- a/git/test/performance/lib.py +++ b/git/test/performance/lib.py @@ -72,7 +72,7 @@ def setUpClass(cls): cls.puregitrwrepo = Repo(dirname, odbt=GitDB) @classmethod - def tearDownAll(cls): + def tearDownClass(cls): shutil.rmtree(cls.gitrwrepo.working_dir) #} END base classes