Rev 3326: bzrlib.tests.per_lock switched from test_suite() to load_tests(). in file:///v/home/vila/src/bzr/experimental/faster-selftest/

Vincent Ladeuil v.ladeuil+lp at free.fr
Mon Mar 31 16:13:46 BST 2008


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

------------------------------------------------------------
revno: 3326
revision-id: v.ladeuil+lp at free.fr-20080331151341-3z5kns4ahzwah2zc
parent: v.ladeuil+lp at free.fr-20080331150821-2iwknnd0f8h9fmlv
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: use-filter-by-module-test-loader
timestamp: Mon 2008-03-31 17:13:41 +0200
message:
  bzrlib.tests.per_lock switched from test_suite() to load_tests().
  
  * bzrlib/tests/per_lock/__init__.py:
  (load_tests): Preferred to test_suite().
  
  * bzrlib/tests/__init__.py:
  (test_suite): bzrlib.tests.perl_lock moved from packages_to_test
  to testmod_names.
modified:
  bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
  bzrlib/tests/per_lock/__init__.py __init__.py-20070314201444-u92yjsqrkh2m3qcb-1
-------------- next part --------------
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py	2008-03-31 15:08:21 +0000
+++ b/bzrlib/tests/__init__.py	2008-03-31 15:13:41 +0000
@@ -117,14 +117,12 @@
     triggered when running selftest, not when importing the command.
     """
     import bzrlib.tests.inventory_implementations
-    import bzrlib.tests.per_lock
     import bzrlib.tests.repository_implementations
     import bzrlib.tests.revisionstore_implementations
     import bzrlib.tests.tree_implementations
     import bzrlib.tests.workingtree_implementations
     return [
             bzrlib.tests.inventory_implementations,
-            bzrlib.tests.per_lock,
             bzrlib.tests.repository_implementations,
             bzrlib.tests.revisionstore_implementations,
             bzrlib.tests.tree_implementations,
@@ -2653,6 +2651,7 @@
                    'bzrlib.tests.interrepository_implementations',
                    'bzrlib.tests.intertree_implementations',
                    'bzrlib.tests.interversionedfile_implementations',
+                   'bzrlib.tests.per_lock',
                    'bzrlib.tests.test__dirstate_helpers',
                    'bzrlib.tests.test_ancestry',
                    'bzrlib.tests.test_annotate',

=== modified file 'bzrlib/tests/per_lock/__init__.py'
--- a/bzrlib/tests/per_lock/__init__.py	2007-03-14 23:40:34 +0000
+++ b/bzrlib/tests/per_lock/__init__.py	2008-03-31 15:13:41 +0000
@@ -63,13 +63,15 @@
         return result
 
 
-def test_suite():
-    result = tests.TestSuite()
+def load_tests(basic_tests, module, loader):
+    result = loader.suiteClass()
+    # add the tests for this module
+    result.addTests(basic_tests)
+
     test_lock_implementations = [
         'bzrlib.tests.per_lock.test_lock',
         'bzrlib.tests.per_lock.test_temporary_write_lock',
         ]
     adapter = LockTestProviderAdapter(lock._lock_classes)
-    loader = tests.TestLoader()
     tests.adapt_modules(test_lock_implementations, adapter, loader, result)
     return result



More information about the bazaar-commits mailing list