summaryrefslogtreecommitdiff
path: root/git/test/test_submodule.py
diff options
context:
space:
mode:
authorAndreas Maier <maiera@de.ibm.com>2016-10-21 11:11:22 +0200
committerAndreas Maier <maiera@de.ibm.com>2016-10-24 16:02:31 +0200
commitf3d5df2ce3addd9e9e1863f4f33665a16b415b71 (patch)
treec22a1d74ed859e6eaca9903fa8600ec51c3b44db /git/test/test_submodule.py
parent5149c807ec5f396c1114851ffbd0f88d65d4c84f (diff)
downloadgitpython-f3d5df2ce3addd9e9e1863f4f33665a16b415b71.tar.gz
Fixes to support Python 2.6 again.
Details: - Added Python 2.6 again to .travis.yml (it was removed in commit 4486bcb). - Replaced the use of dictionary comprehensions in `git/cmd.py` around line 800 with the code before that change (in commit 25a2ebf). Reason: dict comprehensions were introduced only in Python 2.7. - Changed the import source for `SkipTest` and `skipIf` from `unittest.case` to first trying `unittest` and upon ImportError from `unittest2`. This was done in `git/util.py` and in several testcases. Reason: `SkipTest` and `skipIf` were introduced to unittest only in Python 2.7, and `unittest2` is a backport of `unittest` additions to Python 2.6. - In git/test/lib/helper.py, fixed the definition of `assertRaisesRegex` to work on py26. - For Python 2.6, added the `unittest2` dependency to `requirements.txt` and changed `.travis.yml` to install `unittest2`. Because git/util.py uses SkipTest from unittest/unittest2, the dependency could not be added to `test-requirements.txt`. - Fixed an assertion in `git/test/test_index.py` to also allow a Python 2.6 specific exception message. - In `is_cygwin_git()` in `git/util.py`, replaced `check_output()` with `Popen()`. It was added in Python 2.7. - Enabled Python 2.6 for Windows: - Added Python 2.6 for MINGW in .appveyor.yml. - When defining `PROC_CREATIONFLAGS` in `git/cmd.py`, made use of certain win32 and subprocess flags that were introduced in Python 2.7, dependent on whether we run on Python 2.7 or higher. - In `AutoInterrupt.__del__()` in `git/cmd.py`, allowed for `os` not having `kill()`. `os.kill()` was added for Windows in Python 2.7 (For Linux, it existed in Python 2.6 already).
Diffstat (limited to 'git/test/test_submodule.py')
-rw-r--r--git/test/test_submodule.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/git/test/test_submodule.py b/git/test/test_submodule.py
index 7b05f49a..59a40fa0 100644
--- a/git/test/test_submodule.py
+++ b/git/test/test_submodule.py
@@ -3,7 +3,10 @@
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
import os
import sys
-from unittest.case import skipIf
+try:
+ from unittest import skipIf
+except ImportError:
+ from unittest2 import skipIf
import git
from git.cmd import Git