Rev 3213: And packages_to_test is now empty and ready to be deleted. in file:///v/home/vila/src/bzr/experimental/selftest/

Vincent Ladeuil v.ladeuil+lp at free.fr
Thu Feb 14 16:09:10 GMT 2008


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

------------------------------------------------------------
revno: 3213
revision-id:v.ladeuil+lp at free.fr-20080214160905-7naswoutvt6qk5uh
parent: v.ladeuil+lp at free.fr-20080214154839-4ypvfqmvlduf1vsa
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: selftest
timestamp: Thu 2008-02-14 17:09:05 +0100
message:
  And packages_to_test is now empty and ready to be deleted.
  
  * bzrlib/tests/__init__.py:
  (test_suite): The modules below don't use test_suite() anymore.
  
  * bzrlib/doc/__init__.py: 
  * bzrlib/doc/api/__init__.py: 
  (load_tests): Preferred to test_suite().
modified:
  bzrlib/doc/__init__.py         __init__.py-20051224020731-eb3eb3ef5b4570df
  bzrlib/doc/api/__init__.py     __init__.py-20051224020744-7b87d590843855bc
  bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
-------------- next part --------------
=== modified file 'bzrlib/doc/__init__.py'
--- a/bzrlib/doc/__init__.py	2006-10-05 05:37:25 +0000
+++ b/bzrlib/doc/__init__.py	2008-02-14 16:09:05 +0000
@@ -20,7 +20,16 @@
 for man page generation.
 """
 
-    
-def test_suite():
-    import bzrlib.doc.api
-    return bzrlib.doc.api.test_suite()
+
+def load_tests(basic_tests, module, loader):
+    suite = loader.suiteClass()
+    # add the tests for this module (obviously none so far)
+    suite.addTests(basic_tests)
+
+    testmod_names = [
+        'bzrlib.doc.api',
+        ]
+
+    suite.addTests(loader.loadTestsFromModuleNames(testmod_names))
+
+    return suite

=== modified file 'bzrlib/doc/api/__init__.py'
--- a/bzrlib/doc/api/__init__.py	2008-01-21 14:49:18 +0000
+++ b/bzrlib/doc/api/__init__.py	2008-02-14 16:09:05 +0000
@@ -29,7 +29,9 @@
 
 from bzrlib import tests
 
-def test_suite():
+def load_tests(basic_tests, module, loader):
+    """This module creates its own test suite with DocFileSuite."""
+
     dir_ = os.path.dirname(__file__)
     if os.path.isdir(dir_):
         candidates = os.listdir(dir_)

=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py	2008-02-14 15:48:39 +0000
+++ b/bzrlib/tests/__init__.py	2008-02-14 16:09:05 +0000
@@ -131,9 +131,7 @@
     The packages are not globally imported so that import failures are
     triggered when running selftest, not when importing the command.
     """
-    import bzrlib.doc
     return [
-            bzrlib.doc,
             ]
 
 
@@ -2598,6 +2596,7 @@
     suite on a global basis, but it is not encouraged.
     """
     testmod_names = [
+                   'bzrlib.doc',
                    'bzrlib.util.tests.test_bencode',
                    'bzrlib.tests.blackbox',
                    'bzrlib.tests.branch_implementations',



More information about the bazaar-commits mailing list