Rev 3236: Merge 1.2 branch in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Mon Feb 25 09:21:29 GMT 2008


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 3236
revision-id:pqm at pqm.ubuntu.com-20080225092119-bk1won32t9nw4h6u
parent: pqm at pqm.ubuntu.com-20080224191521-mrdhiyn59r5q2z6l
parent: mbp at sourcefrog.net-20080225072829-3cmqkr9rf19mm0sg
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Mon 2008-02-25 09:21:19 +0000
message:
  Merge 1.2 branch
added:
  bzrlib/plugins/launchpad/test_lp_service.py test_lp_service.py-20080213034527-drf0ucr2x1js3onb-1
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
  bzrlib/plugins/launchpad/__init__.py __init__.py-20060315182712-2d5feebd2a1032dc
  bzrlib/plugins/launchpad/test_lp_indirect.py test_lp_indirect.py-20070126002743-oyle362tzv9cd8mi-1
  bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
  bzrlib/tests/test_transport_implementations.py test_transport_implementations.py-20051227111451-f97c5c7d5c49fce7
  bzrlib/transport/ftp.py        ftp.py-20051116161804-58dc9506548c2a53
    ------------------------------------------------------------
    revno: 3235.1.1
    revision-id:mbp at sourcefrog.net-20080225072829-3cmqkr9rf19mm0sg
    parent: pqm at pqm.ubuntu.com-20080224191521-mrdhiyn59r5q2z6l
    parent: pqm at pqm.ubuntu.com-20080215084056-2vb2i797v2pkp0ih
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: integration
    timestamp: Mon 2008-02-25 18:28:29 +1100
    message:
      Merge 1.2 branch
    added:
      bzrlib/plugins/launchpad/test_lp_service.py test_lp_service.py-20080213034527-drf0ucr2x1js3onb-1
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
      bzrlib/plugins/launchpad/__init__.py __init__.py-20060315182712-2d5feebd2a1032dc
      bzrlib/plugins/launchpad/test_lp_indirect.py test_lp_indirect.py-20070126002743-oyle362tzv9cd8mi-1
      bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
      bzrlib/tests/test_transport_implementations.py test_transport_implementations.py-20051227111451-f97c5c7d5c49fce7
      bzrlib/transport/ftp.py        ftp.py-20051116161804-58dc9506548c2a53
    ------------------------------------------------------------
    revno: 3221.4.2
    revision-id:pqm at pqm.ubuntu.com-20080215084056-2vb2i797v2pkp0ih
    parent: pqm at pqm.ubuntu.com-20080215062156-x6i1rw2dy7xd9rk2
    parent: mbp at sourcefrog.net-20080215071023-hg96fkd6hnoi6j3b
    committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
    branch nick: 1.2
    timestamp: Fri 2008-02-15 08:40:56 +0000
    message:
      prepare 1.2 final
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/__init__.py             __init__.py-20050309040759-33e65acf91bbcd5d
        ------------------------------------------------------------
        revno: 3221.1.13
        revision-id:mbp at sourcefrog.net-20080215071023-hg96fkd6hnoi6j3b
        parent: mbp at sourcefrog.net-20080215044019-okgf247i7nlj71tv
        committer: Martin Pool <mbp at sourcefrog.net>
        branch nick: prepare-1.2
        timestamp: Fri 2008-02-15 18:10:23 +1100
        message:
          Release 1.2 final
        modified:
          NEWS                           NEWS-20050323055033-4e00b5db738777ff
          bzrlib/__init__.py             __init__.py-20050309040759-33e65acf91bbcd5d
    ------------------------------------------------------------
    revno: 3221.4.1
    revision-id:pqm at pqm.ubuntu.com-20080215062156-x6i1rw2dy7xd9rk2
    parent: pqm at pqm.ubuntu.com-20080208064756-bg0zu0y4e789j50r
    parent: mbp at sourcefrog.net-20080215044019-okgf247i7nlj71tv
    committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
    branch nick: 1.2
    timestamp: Fri 2008-02-15 06:21:56 +0000
    message:
      integrated changes for 1.2r1 release
    added:
      bzrlib/plugins/launchpad/test_lp_service.py test_lp_service.py-20080213034527-drf0ucr2x1js3onb-1
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/__init__.py             __init__.py-20050309040759-33e65acf91bbcd5d
      bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
      bzrlib/bundle/commands.py      __init__.py-20050617152058-1b6530d9ab85c11c
      bzrlib/dirstate.py             dirstate.py-20060728012006-d6mvoihjb3je9peu-1
      bzrlib/errors.py               errors.py-20050309040759-20512168c4e14fbd
      bzrlib/plugins/launchpad/__init__.py __init__.py-20060315182712-2d5feebd2a1032dc
      bzrlib/plugins/launchpad/test_lp_indirect.py test_lp_indirect.py-20070126002743-oyle362tzv9cd8mi-1
      bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
      bzrlib/tests/blackbox/test_bundle_info.py test_bundle_info.py-20070816181255-eiuodwxuqu7w7gxf-1
      bzrlib/tests/test_dirstate.py  test_dirstate.py-20060728012006-d6mvoihjb3je9peu-2
      bzrlib/tests/test_errors.py    test_errors.py-20060210110251-41aba2deddf936a8
      bzrlib/tests/test_transport_implementations.py test_transport_implementations.py-20051227111451-f97c5c7d5c49fce7
      bzrlib/tests/test_workingtree_4.py test_workingtree_4.p-20070223025758-531n3tznl3zacv2o-1
      bzrlib/transport/ftp.py        ftp.py-20051116161804-58dc9506548c2a53
      bzrlib/workingtree_4.py        workingtree_4.py-20070208044105-5fgpc5j3ljlh5q6c-1
    ------------------------------------------------------------
    revno: 3221.1.12
    revision-id:mbp at sourcefrog.net-20080215044019-okgf247i7nlj71tv
    parent: mbp at sourcefrog.net-20080213082208-ewzg938ayzjfs1gw
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: prepare-1.2rc1
    timestamp: Fri 2008-02-15 15:40:19 +1100
    message:
      Update Launchpad indirection tests to allow for xmlrpcs being sent to edge by default
    modified:
      bzrlib/plugins/launchpad/test_lp_indirect.py test_lp_indirect.py-20070126002743-oyle362tzv9cd8mi-1
    ------------------------------------------------------------
    revno: 3221.1.11
    revision-id:mbp at sourcefrog.net-20080213082208-ewzg938ayzjfs1gw
    parent: mbp at sourcefrog.net-20080213075723-8j651ka0iiipjfbq
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: prepare-1.2rc1
    timestamp: Wed 2008-02-13 19:22:08 +1100
    message:
      Release 1.2rc1
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/__init__.py             __init__.py-20050309040759-33e65acf91bbcd5d
    ------------------------------------------------------------
    revno: 3221.1.10
    revision-id:mbp at sourcefrog.net-20080213075723-8j651ka0iiipjfbq
    parent: mbp at sourcefrog.net-20080213075259-an2y8ya0j2z4o077
    parent: v.ladeuil+lp at free.fr-20080210155122-gib8voz2xbausm5c
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: prepare-1.2rc1
    timestamp: Wed 2008-02-13 18:57:23 +1100
    message:
      [\#137832] raise UnavailableFeature from inside tests, not from setup
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
      bzrlib/tests/test_transport_implementations.py test_transport_implementations.py-20051227111451-f97c5c7d5c49fce7
      bzrlib/transport/ftp.py        ftp.py-20051116161804-58dc9506548c2a53
        ------------------------------------------------------------
        revno: 3221.6.1
        revision-id:v.ladeuil+lp at free.fr-20080210155122-gib8voz2xbausm5c
        parent: pqm at pqm.ubuntu.com-20080208064756-bg0zu0y4e789j50r
        committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
        branch nick: 137823-selftest-broken-osx
        timestamp: Sun 2008-02-10 16:51:22 +0100
        message:
          Fix bug #137823 by raising UnavailableFeature *after* the fake ftp server
          setup is completed.
          
          *  bzrlib/transport/ftp.py:
          (get_test_permutations.UnavailableFTPServer): Raising an exception
          during setup is not correctly handled by the test
          framework. Better raise it on get_url() and get_bogus_url() which
          are always called first when using a server.
          
          *  bzrlib/builtins.py:
          (cmd_selftest.run): 'info()' is about to be deprecated, use note()
          instead.
        modified:
          NEWS                           NEWS-20050323055033-4e00b5db738777ff
          bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
          bzrlib/tests/test_transport_implementations.py test_transport_implementations.py-20051227111451-f97c5c7d5c49fce7
          bzrlib/transport/ftp.py        ftp.py-20051116161804-58dc9506548c2a53
    ------------------------------------------------------------
    revno: 3221.1.9
    revision-id:mbp at sourcefrog.net-20080213075259-an2y8ya0j2z4o077
    parent: mbp at sourcefrog.net-20080213014247-buajf9y91w5xuaa8
    parent: mbp at sourcefrog.net-20080213064353-y03ge29mnhkktmtp
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: prepare-1.2rc1
    timestamp: Wed 2008-02-13 18:52:59 +1100
    message:
      Treat failure to load plugin test suites as a fatal error; fix Launchpad tests
    added:
      bzrlib/plugins/launchpad/test_lp_service.py test_lp_service.py-20080213034527-drf0ucr2x1js3onb-1
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/plugins/launchpad/__init__.py __init__.py-20060315182712-2d5feebd2a1032dc
      bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
    ------------------------------------------------------------
    revno: 3221.5.5
    revision-id:mbp at sourcefrog.net-20080213064353-y03ge29mnhkktmtp
    parent: mbp at sourcefrog.net-20080213035319-optr3exo2xw39atk
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: 189771_launchpad_tests
    timestamp: Wed 2008-02-13 17:43:53 +1100
    message:
      Tweak indents
    modified:
      bzrlib/plugins/launchpad/__init__.py __init__.py-20060315182712-2d5feebd2a1032dc
    ------------------------------------------------------------
    revno: 3221.5.4
    revision-id:mbp at sourcefrog.net-20080213035319-optr3exo2xw39atk
    parent: mbp at sourcefrog.net-20080213034940-a78z9vple6wa8kef
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: 189771_launchpad_tests
    timestamp: Wed 2008-02-13 14:53:19 +1100
    message:
      Add news item for #189771
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
    ------------------------------------------------------------
    revno: 3221.5.3
    revision-id:mbp at sourcefrog.net-20080213034940-a78z9vple6wa8kef
    parent: mbp at sourcefrog.net-20080213034558-anhm9j1l3mbbmnyo
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: 189771_launchpad_tests
    timestamp: Wed 2008-02-13 14:49:40 +1100
    message:
      Fix news indents
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
    ------------------------------------------------------------
    revno: 3221.5.2
    revision-id:mbp at sourcefrog.net-20080213034558-anhm9j1l3mbbmnyo
    parent: mbp at sourcefrog.net-20080213030249-5mspg3fydg8b3xg5
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: 189771_launchpad_tests
    timestamp: Wed 2008-02-13 14:45:58 +1100
    message:
      Add in thumpers tests for selection of the right Launchpad instance
    added:
      bzrlib/plugins/launchpad/test_lp_service.py test_lp_service.py-20080213034527-drf0ucr2x1js3onb-1
    modified:
      bzrlib/plugins/launchpad/__init__.py __init__.py-20060315182712-2d5feebd2a1032dc
    ------------------------------------------------------------
    revno: 3221.5.1
    revision-id:mbp at sourcefrog.net-20080213030249-5mspg3fydg8b3xg5
    parent: pqm at pqm.ubuntu.com-20080208064756-bg0zu0y4e789j50r
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: 189771_launchpad_tests
    timestamp: Wed 2008-02-13 14:02:49 +1100
    message:
      Treat failure to load plugin test suites as a fatal error
    modified:
      bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
=== added file 'bzrlib/plugins/launchpad/test_lp_service.py'
--- a/bzrlib/plugins/launchpad/test_lp_service.py	1970-01-01 00:00:00 +0000
+++ b/bzrlib/plugins/launchpad/test_lp_service.py	2008-02-13 03:45:58 +0000
@@ -0,0 +1,86 @@
+# Copyright (C) 2008 Canonical Ltd
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+"""Tests for selection of the right Launchpad service by environment"""
+
+import os
+
+from bzrlib.tests import TestCase
+from bzrlib.plugins.launchpad.lp_registration import (
+    InvalidLaunchpadInstance, LaunchpadService)
+
+
+class LaunchpadServiceTests(TestCase):
+    """Test that the correct Launchpad instance is chosen."""
+
+    def setUp(self):
+        super(LaunchpadServiceTests, self).setUp()
+        # make sure we have a reproducible standard environment
+        self._captureVar('BZR_LP_XMLRPC_URL', None)
+
+    def test_default_service(self):
+        service = LaunchpadService()
+        self.assertEqual('https://xmlrpc.launchpad.net/bazaar/',
+                         service.service_url)
+
+    def test_alter_default_service_url(self):
+        LaunchpadService.DEFAULT_SERVICE_URL = 'http://example.com/'
+        try:
+            service = LaunchpadService()
+            self.assertEqual('http://example.com/',
+                             service.service_url)
+        finally:
+            LaunchpadService.DEFAULT_SERVICE_URL = \
+                LaunchpadService.LAUNCHPAD_INSTANCE['production']
+
+    def test_staging_service(self):
+        service = LaunchpadService(lp_instance='staging')
+        self.assertEqual('https://xmlrpc.staging.launchpad.net/bazaar/',
+                         service.service_url)
+
+    def test_edge_service(self):
+        service = LaunchpadService(lp_instance='edge')
+        self.assertEqual('https://xmlrpc.edge.launchpad.net/bazaar/',
+                         service.service_url)
+
+    def test_dev_service(self):
+        service = LaunchpadService(lp_instance='dev')
+        self.assertEqual('http://xmlrpc.launchpad.dev/bazaar/',
+                         service.service_url)
+
+    def test_demo_service(self):
+        service = LaunchpadService(lp_instance='demo')
+        self.assertEqual('https://xmlrpc.demo.launchpad.net/bazaar/',
+                         service.service_url)
+
+    def test_unknown_service(self):
+        error = self.assertRaises(InvalidLaunchpadInstance,
+                                  LaunchpadService,
+                                  lp_instance='fubar')
+        self.assertEqual('fubar is not a valid Launchpad instance.',
+                         str(error))
+
+    def test_environment_overrides_default(self):
+        os.environ['BZR_LP_XMLRPC_URL'] = 'http://example.com/'
+        service = LaunchpadService()
+        self.assertEqual('http://example.com/',
+                         service.service_url)
+
+    def test_environment_overrides_specified_service(self):
+        os.environ['BZR_LP_XMLRPC_URL'] = 'http://example.com/'
+        service = LaunchpadService(lp_instance='staging')
+        self.assertEqual('http://example.com/',
+                         service.service_url)

=== modified file 'NEWS'
--- a/NEWS	2008-02-24 16:44:46 +0000
+++ b/NEWS	2008-02-25 07:28:29 +0000
@@ -80,8 +80,16 @@
       format. (Robert Collins)
 
 
-bzr 1.2rc1 (not released yet)
------------------------------
+bzr 1.2 2008-02-15
+------------------
+
+  BUG FIXES:
+
+    * Fix failing test in Launchpad plugin. (Martin Pool)
+
+
+bzr 1.2rc1 2008-02-13
+---------------------
 
   NOTES WHEN UPGRADING:
   
@@ -163,6 +171,14 @@
 
     * Clearer error when ``version-info --custom`` is used without
       ``--template`` (Lukáš Lalinský)
+
+    * Don't raise UnavailableFeature during test setup when medusa is not
+      available or tearDown is never called leading to nasty side effects.
+      (#137823, Vincent Ladeuil)
+
+    * If a plugin's test suite cannot be loaded, for example because of a syntax
+      error in the tests, then ``selftest`` fails, rather than just printing 
+      a warning.  (Martin Pool, #189771)
       
     * List possible values for BZR_SSH environment variable in env-variables
       help topic. (Alexander Belchenko, #181842)
@@ -174,7 +190,7 @@
       by the test framework, which lets bzr tests cleanly run from a normal
       unittest runner.
       (#124153, #124849, Martin Pool, Jonathan Lange)
- 
+
     * ``pull --quiet`` is now more quiet, in particular a message is no longer
       printed when the remembered pull location is used. (James Westby,
       #185907)
@@ -209,9 +225,9 @@
 
   TESTING:
 
-   * selftest now accepts --load-list <file> to load a test id list. This
-     speeds up running the test suite on a limited set of tests.
-     (Vincent Ladeuil)
+    * selftest now accepts --load-list <file> to load a test id list. This
+      speeds up running the test suite on a limited set of tests.
+      (Vincent Ladeuil)
 
   INTERNALS:
 
@@ -637,7 +653,7 @@
      variable. (Alexander Belchenko, workaround for bug #107593)
 
    * The pack format is now accessible as "pack-0.92", or "pack-0.92-subtree" 
-     to enable the subtree functions.
+     to enable the subtree functions (for example, for bzr-svn).  
      See http://doc.bazaar-vcs.org/latest/developer/packrepo.html
      (Martin Pool)
 

=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2008-02-24 16:42:13 +0000
+++ b/bzrlib/builtins.py	2008-02-25 07:28:29 +0000
@@ -2663,9 +2663,9 @@
             if benchfile is not None:
                 benchfile.close()
         if result:
-            info('tests passed')
+            note('tests passed')
         else:
-            info('tests failed')
+            note('tests failed')
         return int(not result)
 
 

=== modified file 'bzrlib/plugins/launchpad/__init__.py'
--- a/bzrlib/plugins/launchpad/__init__.py	2008-02-05 02:28:04 +0000
+++ b/bzrlib/plugins/launchpad/__init__.py	2008-02-13 06:43:53 +0000
@@ -181,17 +181,18 @@
     """Called by bzrlib to fetch tests for this plugin"""
     from unittest import TestSuite, TestLoader
     from bzrlib.plugins.launchpad import (
-        test_register, test_lp_indirect, test_lp_registration, test_account)
+         test_account, test_lp_indirect, test_lp_service, test_register,
+         )
 
     loader = TestLoader()
     suite = TestSuite()
-    for m in [
+    for module in [
         test_account,
         test_register,
         test_lp_indirect,
-        test_lp_registration,
+        test_lp_service,
         ]:
-        suite.addTests(loader.loadTestsFromModule(m))
+        suite.addTests(loader.loadTestsFromModule(module))
     return suite
 
 _launchpad_help = """Integration with Launchpad.net

=== modified file 'bzrlib/plugins/launchpad/test_lp_indirect.py'
--- a/bzrlib/plugins/launchpad/test_lp_indirect.py	2008-01-22 23:11:21 +0000
+++ b/bzrlib/plugins/launchpad/test_lp_indirect.py	2008-02-15 04:40:19 +0000
@@ -56,7 +56,7 @@
         self.assertEquals('http://bazaar.launchpad.net/~apt/apt/devel',
                           transport._resolve('lp:apt', factory))
         # Make sure that resolve went to the production server.
-        self.assertEquals('https://xmlrpc.launchpad.net/bazaar/',
+        self.assertEquals('https://xmlrpc.edge.launchpad.net/bazaar/',
                           factory._service_url)
 
     def test_staging(self):

=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py	2008-02-24 16:42:13 +0000
+++ b/bzrlib/tests/__init__.py	2008-02-25 07:28:29 +0000
@@ -2816,21 +2816,19 @@
         suite.addTest(doc_suite)
 
     default_encoding = sys.getdefaultencoding()
-    for name, plugin in  [(n, p) for (n, p) in bzrlib.plugin.plugins().items()
-                          if (keep_only is None
-                              or id_filter.is_module_name_used(
-                p.module.__name__))]:
-        try:
-            plugin_suite = plugin.test_suite()
-        except ImportError, e:
-            bzrlib.trace.warning(
-                'Unable to test plugin "%s": %s', name, e)
-        else:
-            if plugin_suite is not None:
-                if keep_only is not None:
-                    plugin_suite = filter_suite_by_id_list(plugin_suite,
-                                                           id_filter)
-                suite.addTest(plugin_suite)
+    for name, plugin in bzrlib.plugin.plugins().items():
+        if keep_only is not None:
+            if not id_filter.is_module_name_used(plugin.module.__name__):
+                continue
+        plugin_suite = plugin.test_suite()
+        # We used to catch ImportError here and turn it into just a warning,
+        # but really if you don't have --no-plugins this should be a failure.
+        # mbp 20080213 - see http://bugs.launchpad.net/bugs/189771
+        if plugin_suite is not None:
+            if keep_only is not None:
+                plugin_suite = filter_suite_by_id_list(plugin_suite,
+                                                       id_filter)
+            suite.addTest(plugin_suite)
         if default_encoding != sys.getdefaultencoding():
             bzrlib.trace.warning(
                 'Plugin "%s" tried to reset default encoding to: %s', name,

=== modified file 'bzrlib/tests/test_transport_implementations.py'
--- a/bzrlib/tests/test_transport_implementations.py	2008-02-04 09:32:07 +0000
+++ b/bzrlib/tests/test_transport_implementations.py	2008-02-25 07:28:29 +0000
@@ -96,7 +96,7 @@
                     result.append(scenario)
             except errors.DependencyNotPresent, e:
                 # Continue even if a dependency prevents us 
-                # from running this test
+                # from adding this test
                 pass
         return result
 

=== modified file 'bzrlib/transport/ftp.py'
--- a/bzrlib/transport/ftp.py	2007-11-25 14:52:24 +0000
+++ b/bzrlib/transport/ftp.py	2008-02-10 15:51:22 +0000
@@ -576,9 +576,21 @@
         return [(FtpTransport, ftp_server.FTPServer)]
     else:
         # Dummy server to have the test suite report the number of tests
-        # needing that feature.
+        # needing that feature. We raise UnavailableFeature from methods before
+        # the test server is being used. Doing so in the setUp method has bad
+        # side-effects (tearDown is never called).
         class UnavailableFTPServer(object):
+
             def setUp(self):
+                pass
+
+            def tearDown(self):
+                pass
+
+            def get_url(self):
+                raise tests.UnavailableFeature(tests.FTPServerFeature)
+
+            def get_bogus_url(self):
                 raise tests.UnavailableFeature(tests.FTPServerFeature)
 
         return [(FtpTransport, UnavailableFTPServer)]




More information about the bazaar-commits mailing list