Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Drop support for testtools, instead depend on python >= 2.7 or unitte…

…st2.
  • Loading branch information...
commit c2b994f41deff964b225621962a7391c49cdfbba 1 parent 86ce835
@jelmer authored
View
5 HACKING
@@ -23,8 +23,3 @@ will run the tests using unittest on Python 2.7 and higher, and using
unittest2 (which you will need to have installed) on older versions of Python.
$ make check
-
-Alternatively, if you have testtools installed you can run the testsuite by
-overriding the test runner:
-
- $ make check TESTRUNNER=testtools.run
View
5 NEWS
@@ -6,6 +6,11 @@
* New ``Repo.clone`` method. (Jelmer Vernooij, #725369)
+ CHANGES
+
+ * unittest2 or python >= 2.7 is now required for the testsuite.
+ testtools is no longer supported. (Jelmer Vernooij, #830713)
+
0.8.0 2011-08-07
FEATURES
View
14 dulwich/tests/__init__.py
@@ -30,18 +30,10 @@
if sys.version_info >= (2, 7):
# If Python itself provides an exception, use that
import unittest
- from unittest import SkipTest as TestSkipped
- from unittest import TestCase
+ from unittest import SkipTest, TestCase
else:
- try:
- import unittest2 as unittest
- from unittest2 import SkipTest as TestSkipped
- from unittest2 import TestCase
- except ImportError:
- import unittest
- from testtools.testcase import TestSkipped
- from testtools.testcase import TestCase
- TestCase.skipException = TestSkipped
+ import unittest2 as unittest
+ from unittest2 import SkipTest, TestCase
class BlackboxTestCase(TestCase):
View
6 dulwich/tests/compat/test_client.py
@@ -35,7 +35,7 @@
repo,
)
from dulwich.tests import (
- TestSkipped,
+ SkipTest,
)
from dulwich.tests.compat.utils import (
@@ -175,7 +175,7 @@ def setUp(self):
CompatTestCase.setUp(self)
DulwichClientTestBase.setUp(self)
if check_for_daemon(limit=1):
- raise TestSkipped('git-daemon was already running on port %s' %
+ raise SkipTest('git-daemon was already running on port %s' %
protocol.TCP_GIT_PORT)
fd, self.pidfile = tempfile.mkstemp(prefix='dulwich-test-git-client',
suffix=".pid")
@@ -186,7 +186,7 @@ def setUp(self):
'--detach', '--reuseaddr', '--enable=receive-pack',
'--listen=localhost', self.gitroot], cwd=self.gitroot)
if not check_for_daemon():
- raise TestSkipped('git-daemon failed to start')
+ raise SkipTest('git-daemon failed to start')
def tearDown(self):
try:
View
10 dulwich/tests/compat/test_utils.py
@@ -20,8 +20,8 @@
"""Tests for git compatibility utilities."""
from dulwich.tests import (
+ SkipTest,
TestCase,
- TestSkipped,
)
from dulwich.tests.compat import utils
@@ -61,11 +61,11 @@ def test_git_version_extra(self):
def assertRequireSucceeds(self, required_version):
try:
utils.require_git_version(required_version)
- except TestSkipped:
+ except SkipTest:
self.fail()
def assertRequireFails(self, required_version):
- self.assertRaises(TestSkipped, utils.require_git_version,
+ self.assertRaises(SkipTest, utils.require_git_version,
required_version)
def test_require_git_version(self):
@@ -87,6 +87,6 @@ def test_require_git_version(self):
self.assertRequireSucceeds((1, 7, 0, 2))
self.assertRequireFails((1, 7, 0, 3))
self.assertRequireFails((1, 7, 1))
- except TestSkipped, e:
- # This test is designed to catch all TestSkipped exceptions.
+ except SkipTest, e:
+ # This test is designed to catch all SkipTest exceptions.
self.fail('Test unexpectedly skipped: %s' % e)
View
4 dulwich/tests/compat/test_web.py
@@ -31,7 +31,7 @@
DictBackend,
)
from dulwich.tests import (
- TestSkipped,
+ SkipTest,
)
from dulwich.web import (
HTTPGitApplication,
@@ -144,4 +144,4 @@ def _make_app(self, backend):
def test_push_to_dulwich(self):
# Note: remove this if dumb pushing is supported
- raise TestSkipped('Dumb web pushing not supported.')
+ raise SkipTest('Dumb web pushing not supported.')
View
12 dulwich/tests/compat/utils.py
@@ -30,8 +30,8 @@
from dulwich.protocol import TCP_GIT_PORT
from dulwich.tests import (
+ SkipTest,
TestCase,
- TestSkipped,
)
_DEFAULT_GIT = 'git'
@@ -77,12 +77,12 @@ def require_git_version(required_version, git_path=_DEFAULT_GIT):
:param git_path: Path to the git executable; defaults to the version in
the system path.
:raise ValueError: if the required version tuple has too many parts.
- :raise TestSkipped: if no suitable git version was found at the given path.
+ :raise SkipTest: if no suitable git version was found at the given path.
"""
found_version = git_version(git_path=git_path)
if found_version is None:
- raise TestSkipped('Test requires git >= %s, but c git not found' %
- (required_version, ))
+ raise SkipTest('Test requires git >= %s, but c git not found' %
+ (required_version, ))
if len(required_version) > _VERSION_LEN:
raise ValueError('Invalid version tuple %s, expected %i parts' %
@@ -96,8 +96,8 @@ def require_git_version(required_version, git_path=_DEFAULT_GIT):
if found_version < required_version:
required_version = '.'.join(map(str, required_version))
found_version = '.'.join(map(str, found_version))
- raise TestSkipped('Test requires git >= %s, found %s' %
- (required_version, found_version))
+ raise SkipTest('Test requires git >= %s, found %s' %
+ (required_version, found_version))
def run_git(args, git_path=_DEFAULT_GIT, input=None, capture_stdout=False,
View
6 dulwich/tests/test_fastexport.py
@@ -32,8 +32,8 @@
MemoryRepo,
)
from dulwich.tests import (
+ SkipTest,
TestCase,
- TestSkipped,
)
@@ -47,7 +47,7 @@ def setUp(self):
try:
from dulwich.fastexport import GitFastExporter
except ImportError:
- raise TestSkipped("python-fastimport not available")
+ raise SkipTest("python-fastimport not available")
self.fastexporter = GitFastExporter(self.stream, self.store)
def test_emit_blob(self):
@@ -93,7 +93,7 @@ def setUp(self):
try:
from dulwich.fastexport import GitImportProcessor
except ImportError:
- raise TestSkipped("python-fastimport not available")
+ raise SkipTest("python-fastimport not available")
self.processor = GitImportProcessor(self.repo)
def test_commit_handler(self):
View
4 dulwich/tests/test_file.py
@@ -24,8 +24,8 @@
from dulwich.file import GitFile, fancy_rename
from dulwich.tests import (
+ SkipTest,
TestCase,
- TestSkipped,
)
@@ -70,7 +70,7 @@ def test_dest_exists(self):
def test_dest_opened(self):
if sys.platform != "win32":
- raise TestSkipped("platform allows overwriting open files")
+ raise SkipTest("platform allows overwriting open files")
self.create(self.bar, 'bar contents')
dest_f = open(self.bar, 'rb')
self.assertRaises(OSError, fancy_rename, self.foo, self.bar)
View
4 dulwich/tests/test_patch.py
@@ -37,8 +37,8 @@
write_tree_diff,
)
from dulwich.tests import (
+ SkipTest,
TestCase,
- TestSkipped,
)
@@ -164,7 +164,7 @@ def test_extract_no_version_tail(self):
self.assertEquals(None, version)
def test_extract_mercurial(self):
- raise TestSkipped("git_am_patch_split doesn't handle Mercurial patches properly yet")
+ raise SkipTest("git_am_patch_split doesn't handle Mercurial patches properly yet")
expected_diff = """diff --git a/dulwich/tests/test_patch.py b/dulwich/tests/test_patch.py
--- a/dulwich/tests/test_patch.py
+++ b/dulwich/tests/test_patch.py
View
6 dulwich/tests/utils.py
@@ -47,7 +47,7 @@
)
from dulwich.repo import Repo
from dulwich.tests import (
- TestSkipped,
+ SkipTest,
)
# Plain files are very frequently used in tests, so let the mode be very short.
@@ -142,7 +142,7 @@ def ext_functest_builder(method, func):
This is intended to generate test methods that test both a pure-Python
version and an extension version using common test code. The extension test
- will raise TestSkipped if the extension is not found.
+ will raise SkipTest if the extension is not found.
Sample usage:
@@ -160,7 +160,7 @@ def _do_some_test(self, func_impl):
def do_test(self):
if not isinstance(func, types.BuiltinFunctionType):
- raise TestSkipped("%s extension not found", func.func_name)
+ raise SkipTest("%s extension not found", func.func_name)
method(self, func)
return do_test
Please sign in to comment.
Something went wrong with that request. Please try again.