Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

Commit 23bd045

Browse files
committed
Skip git test when missing required file
1 parent 6f81614 commit 23bd045

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

tests/versioning/tests.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
from __future__ import absolute_import
22

3+
import os.path
4+
import pytest
5+
36
from django.conf import settings
47

58
from raven.versioning import fetch_git_sha, fetch_package_version
69
from raven.utils import six
710

811

12+
def has_git_requirements():
13+
return os.path.join(settings.PROJECT_ROOT, '.git', 'refs', 'heads', 'master')
14+
15+
16+
@pytest.mark.skipif('not has_git_requirements()')
917
def test_fetch_git_sha():
1018
result = fetch_git_sha(settings.PROJECT_ROOT)
1119
assert result is not None

0 commit comments

Comments
 (0)