Skip git test when missing required file

This commit is contained in:
David Cramer 2015-05-21 17:25:16 -07:00
parent 6f81614e66
commit 23bd04541d
1 changed files with 8 additions and 0 deletions

View File

@ -1,11 +1,19 @@
from __future__ import absolute_import
import os.path
import pytest
from django.conf import settings
from raven.versioning import fetch_git_sha, fetch_package_version
from raven.utils import six
def has_git_requirements():
return os.path.join(settings.PROJECT_ROOT, '.git', 'refs', 'heads', 'master')
@pytest.mark.skipif('not has_git_requirements()')
def test_fetch_git_sha():
result = fetch_git_sha(settings.PROJECT_ROOT)
assert result is not None