Skip git-checkout related tests when .git is missing

When running tests from the released tarballs, the
AUTHORs related checks are failing due to missing .git
directory and the fallout caused by it.

Change-Id: Ic960863621f1b239ced299f892466537431d44d5
This commit is contained in:
Dirk Mueller 2013-06-10 14:18:46 +02:00
parent a65e8ee654
commit 6c27ce7c8a
1 changed files with 4 additions and 0 deletions

View File

@ -124,6 +124,10 @@ class SkipFileWrites(tests.BaseTestCase):
self.temp_path = self.useFixture(fixtures.TempDir()).path
self.root_dir = os.path.abspath(os.path.curdir)
self.git_dir = os.path.join(self.root_dir, ".git")
if not os.path.exists(self.git_dir):
self.skipTest("%s is missing; skipping git-related checks"
% self.git_dir)
return
self.filename = os.path.join(self.temp_path, self.filename)
self.option_dict = dict()
if self.option_key is not None: