summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk Mueller <dirk@dmllr.de>2013-06-10 14:18:46 +0200
committerDirk Mueller <dirk@dmllr.de>2013-06-10 14:20:18 +0200
commit6c27ce7c8a96e3e035d0e8fd58bf52abc6c9492d (patch)
tree9720837f03ceccf0c9d2277e97e4690e08632e82
parenta65e8ee654c623fa360ef9e2b4c9b72039a32b39 (diff)
downloadpbr-6c27ce7c8a96e3e035d0e8fd58bf52abc6c9492d.tar.gz
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
-rw-r--r--pbr/tests/test_setup.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/pbr/tests/test_setup.py b/pbr/tests/test_setup.py
index 996119d..4bf70cb 100644
--- a/pbr/tests/test_setup.py
+++ b/pbr/tests/test_setup.py
@@ -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: