Sfoglia il codice sorgente

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).

Jelmer Vernooij 15 anni fa
parent
commit
1dd695d05d

+ 0 - 1
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 (

+ 2 - 4
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.')

+ 3 - 13
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.')

+ 3 - 3
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))