From 1dd695d05d050f9c6728d680925fcbc22d656f69 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 7 Mar 2010 17:44:26 +0100 Subject: [PATCH] Remove unused imports, limit import of nose to one file (so it's easier to replace the SkipTest class with e.g. the one from testtools). --- dulwich/tests/compat/test_pack.py | 1 - dulwich/tests/compat/test_server.py | 6 ++---- dulwich/tests/compat/test_web.py | 16 +++------------- dulwich/tests/compat/utils.py | 6 +++--- 4 files changed, 8 insertions(+), 21 deletions(-) diff --git a/dulwich/tests/compat/test_pack.py b/dulwich/tests/compat/test_pack.py index f8cd76b..52c66c5 100644 --- a/dulwich/tests/compat/test_pack.py +++ b/dulwich/tests/compat/test_pack.py @@ -26,7 +26,6 @@ import shutil import tempfile from dulwich.pack import ( - Pack, write_pack, ) from dulwich.tests.test_pack import ( diff --git a/dulwich/tests/compat/test_server.py b/dulwich/tests/compat/test_server.py index 32afa16..a908885 100644 --- a/dulwich/tests/compat/test_server.py +++ b/dulwich/tests/compat/test_server.py @@ -25,9 +25,6 @@ On *nix, you can kill the tests with Ctrl-Z, "kill %". """ import threading -import unittest - -import nose from dulwich import server from server_utils import ( @@ -36,6 +33,7 @@ from server_utils import ( ) from utils import ( CompatTestCase, + SkipTest, ) @@ -74,4 +72,4 @@ class GitServerTestCase(ServerTests, CompatTestCase): return port def test_push_to_dulwich(self): - raise nose.SkipTest('Skipping push test due to known deadlock bug.') + raise SkipTest('Skipping push test due to known deadlock bug.') diff --git a/dulwich/tests/compat/test_web.py b/dulwich/tests/compat/test_web.py index 0ce2ce7..c30b400 100644 --- a/dulwich/tests/compat/test_web.py +++ b/dulwich/tests/compat/test_web.py @@ -24,16 +24,9 @@ tests, deadlocks may freeze the test process such that it cannot be Ctrl-C'ed. On *nix, you can kill the tests with Ctrl-Z, "kill %". """ -import sys import threading -import unittest from wsgiref import simple_server -import nose - -from dulwich.repo import ( - Repo, - ) from dulwich.server import ( GitBackend, ) @@ -41,16 +34,13 @@ from dulwich.web import ( HTTPGitApplication, ) -from dulwich.tests.utils import ( - open_repo, - tear_down_repo, - ) from server_utils import ( ServerTests, ShutdownServerMixIn, ) from utils import ( CompatTestCase, + SkipTest, ) @@ -105,7 +95,7 @@ class SmartWebTestCase(WebTests, CompatTestCase): def test_push_to_dulwich(self): # TODO(dborowitz): enable after merging thin pack fixes. - raise nose.SkipTest('Skipping push test due to known pack bug.') + raise SkipTest('Skipping push test due to known pack bug.') class DumbWebTestCase(WebTests, CompatTestCase): @@ -124,4 +114,4 @@ class DumbWebTestCase(WebTests, CompatTestCase): def test_push_to_dulwich(self): # Note: remove this if dumb pushing is supported - raise nose.SkipTest('Dumb web pushing not supported.') + raise SkipTest('Dumb web pushing not supported.') diff --git a/dulwich/tests/compat/utils.py b/dulwich/tests/compat/utils.py index d192793..baf4ec0 100644 --- a/dulwich/tests/compat/utils.py +++ b/dulwich/tests/compat/utils.py @@ -24,10 +24,10 @@ import subprocess import tempfile import unittest -import nose +# XXX: Ideally we shouldn't depend on nose but allow other testrunners as well. +from nose import SkipTest from dulwich.repo import Repo -from dulwich.tests.utils import open_repo _DEFAULT_GIT = 'git' @@ -67,7 +67,7 @@ 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 nose.SkipTest('Test requires git >= %s, found %s' % + raise SkipTest('Test requires git >= %s, found %s' % (required_version, found_version)) -- 2.34.1