◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
language: python
python:
- "2.7"
- "3.3"
- "3.4"
- "3.5"
# - "pypy" - won't work as smmap doesn't work (see gitdb/.travis.yml for details)
git:
# a higher depth is needed for most of the tests - must be high enough to not actually be shallow
# as we clone our own repository in the process
Expand All @@ -15,6 +19,7 @@ install:
- git fetch --tags
- pip install -r test-requirements.txt
- pip install codecov sphinx

# generate some reflog as git-python tests need it (in master)
- ./init-tests-after-clone.sh
Expand Down
5 changes: 4 additions & 1 deletion git/objects/submodule/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import logging
import os
import stat
from unittest.case import SkipTest
import uuid

import git
Expand Down
17 changes: 12 additions & 5 deletions git/test/lib/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,24 @@

import contextlib
from functools import wraps
import io
import logging
import os
import tempfile
import textwrap
import time
from unittest import TestCase
import unittest

from git.compat import string_types, is_win, PY3
from git.util import rmtree, cwd

import os.path as osp


ospd = osp.dirname

Expand Down @@ -335,8 +339,11 @@ class TestBase(TestCase):
of the project history ( to assure tests don't fail for others ).
"""

if not PY3:
assertRaisesRegex = unittest.TestCase.assertRaisesRegexp

def _small_repo_url(self):
""":return" a path to a small, clonable repository"""
Expand Down
6 changes: 4 additions & 2 deletions git/test/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
import os
import sys
import tempfile
from unittest import skipIf

from git import (
Blob,
Expand Down @@ -131,7 +134,6 @@ def test_add_unicode(self, rw_repo):
try:
file_path.encode(sys.getfilesystemencoding())
except UnicodeEncodeError:
from unittest import SkipTest
raise SkipTest("Environment doesn't support unicode filenames")

with open(file_path, "wb") as fp:
Expand Down
5 changes: 4 additions & 1 deletion git/test/test_fun.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from io import BytesIO
from stat import S_IFDIR, S_IFREG, S_IFLNK
from unittest.case import skipIf

from git.compat import PY3
from git.index import IndexFile
Expand Down
5 changes: 4 additions & 1 deletion git/test/test_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@

import random
import tempfile
from unittest.case import skipIf

from git import (
RemoteProgress,
6 changes: 4 additions & 2 deletions git/test/test_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
import pickle
import sys
import tempfile
from unittest.case import skipIf

from git import (
InvalidGitRepositoryError,
Expand Down Expand Up @@ -53,7 +56,6 @@
from git.util import HIDE_WINDOWS_KNOWN_ERRORS, cygpath
from git.test.lib import with_rw_directory
from git.util import join_path_native, rmtree, rmfile, bin_to_hex
from unittest import SkipTest

import functools as fnt
import os.path as osp
5 changes: 4 additions & 1 deletion git/test/test_submodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
import os
import sys
from unittest.case import skipIf

import git
from git.cmd import Git
Expand Down
5 changes: 4 additions & 1 deletion git/test/test_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@

from io import BytesIO
import sys
from unittest.case import skipIf

from git import (
Tree,
Expand Down
6 changes: 5 additions & 1 deletion git/test/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@

import tempfile
import time
from unittest.case import skipIf

import ddt

Expand Down
15 changes: 11 additions & 4 deletions git/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@
import logging
import os
import platform
import re
import shutil
import stat
import time
from unittest.case import SkipTest

from gitdb.util import (# NOQA @IgnorePep8
make_sha,
Expand Down Expand Up @@ -303,7 +307,7 @@ def is_cygwin_git(git_executable):
if not is_win:
return False

from subprocess import check_output

is_cygwin = _is_cygwin_cache.get(git_executable)
if is_cygwin is None:
Expand All @@ -316,8 +320,11 @@ def is_cygwin_git(git_executable):

## Just a name given, not a real path.
uname_cmd = osp.join(git_dir, 'uname')
uname = check_output(uname_cmd, universal_newlines=True)
is_cygwin = 'CYGWIN' in uname
except Exception as ex:
log.debug('Failed checking if running in CYGWIN due to: %r', ex)
_is_cygwin_cache[git_executable] = is_cygwin
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
gitdb>=0.6.4
ddt>=1.1.1
Toggle all file notes Toggle all file annotations