Rev 3334: bzrlib.tests.test_transport_implementations use load_tests. in file:///v/home/vila/src/bzr/experimental/faster-selftest/

Vincent Ladeuil v.ladeuil+lp at free.fr
Tue Apr 1 20:26:52 BST 2008


At file:///v/home/vila/src/bzr/experimental/faster-selftest/

------------------------------------------------------------
revno: 3334
revision-id: v.ladeuil+lp at free.fr-20080401192648-oggmitiw5s5o05r9
parent: v.ladeuil+lp at free.fr-20080401172734-sk68h1484oyw0u4h
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: use-filter-by-module-test-loader
timestamp: Tue 2008-04-01 21:26:48 +0200
message:
  bzrlib.tests.test_transport_implementations use load_tests.
  
  * bzrlib/tests/test_transport_implementations.py:
  (load_tests): Defined to avoid special case in
  bzrlib.tests.test_suite().
  
  * bzrlib/tests/__init__.py:
  (test_suite):  bzrlib.tests.test_transport_implementations moved from
  test_transport_implementations to testmod_names.
modified:
  bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
  bzrlib/tests/test_transport_implementations.py test_transport_implementations.py-20051227111451-f97c5c7d5c49fce7
-------------- next part --------------
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py	2008-04-01 08:40:23 +0000
+++ b/bzrlib/tests/__init__.py	2008-04-01 19:26:48 +0000
@@ -2755,6 +2755,7 @@
                    'bzrlib.tests.test_transactions',
                    'bzrlib.tests.test_transform',
                    'bzrlib.tests.test_transport',
+                   'bzrlib.tests.test_transport_implementations',
                    'bzrlib.tests.test_tree',
                    'bzrlib.tests.test_treebuilder',
                    'bzrlib.tests.test_tsort',
@@ -2777,7 +2778,6 @@
                    'bzrlib.tests.workingtree_implementations',
                    ]
     test_transport_implementations = [
-        'bzrlib.tests.test_transport_implementations',
         'bzrlib.tests.test_read_bundle',
         ]
     loader = TestUtil.TestLoader()

=== modified file 'bzrlib/tests/test_transport_implementations.py'
--- a/bzrlib/tests/test_transport_implementations.py	2008-03-27 06:10:18 +0000
+++ b/bzrlib/tests/test_transport_implementations.py	2008-04-01 19:26:48 +0000
@@ -31,6 +31,7 @@
 from bzrlib import (
     errors,
     osutils,
+    tests,
     urlutils,
     )
 from bzrlib.errors import (ConnectionError,
@@ -38,6 +39,7 @@
                            FileExists,
                            InvalidURL,
                            LockError,
+                           NoSmartServer,
                            NoSuchFile,
                            NotLocalUrl,
                            PathError,
@@ -74,10 +76,9 @@
     def get_transport_test_permutations(self, module):
         """Get the permutations module wants to have tested."""
         if getattr(module, 'get_test_permutations', None) is None:
-            raise AssertionError("transport module %s doesn't provide get_test_permutations()"
-                    % module.__name__)
-            ##warning("transport module %s doesn't provide get_test_permutations()"
-            ##       % module.__name__)
+            raise AssertionError(
+                "transport module %s doesn't provide get_test_permutations()"
+                % module.__name__)
             return []
         return module.get_test_permutations()
 
@@ -100,6 +101,14 @@
         return result
 
 
+def load_tests(standard_tests, module, loader):
+    """Multiply tests for tranport implementations."""
+    result = loader.suiteClass()
+    adapter = TransportTestProviderAdapter()
+    for test in tests.iter_suite_tests(standard_tests):
+        result.addTests(adapter.adapt(test))
+    return result
+
 
 class TransportTests(TestTransportImplementation):
 



More information about the bazaar-commits mailing list