Rev 5285: Don't use a test attribute for orig_get_transport. in file:///home/vila/src/bzr/experimental/leaking-tests/

Vincent Ladeuil v.ladeuil+lp at free.fr
Mon Aug 30 08:21:03 BST 2010


At file:///home/vila/src/bzr/experimental/leaking-tests/

------------------------------------------------------------
revno: 5285
revision-id: v.ladeuil+lp at free.fr-20100830072103-hy17xok8lkgbpak4
parent: v.ladeuil+lp at free.fr-20100824160733-zdiq22wnk3swau76
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: catch-them-all
timestamp: Mon 2010-08-30 09:21:03 +0200
message:
  Don't use a test attribute for orig_get_transport.
-------------- next part --------------
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py	2010-08-24 13:03:18 +0000
+++ b/bzrlib/tests/__init__.py	2010-08-30 07:21:03 +0000
@@ -2438,13 +2438,13 @@
         super(TestCaseWithMemoryTransport, self).setUp()
         # Ensure that ConnectedTransport doesn't leak sockets
         def get_transport_with_cleanup(*args, **kwargs):
-            t = self._orig_get_transport(*args, **kwargs)
+            t = orig_get_transport(*args, **kwargs)
             if isinstance(t, _mod_transport.ConnectedTransport):
                 self.addCleanup(t.disconnect)
             return t
 
-        self._orig_get_transport = self.overrideAttr(
-            _mod_transport, 'get_transport', get_transport_with_cleanup)
+        orig_get_transport = self.overrideAttr(_mod_transport, 'get_transport',
+                                               get_transport_with_cleanup)
         self._make_test_root()
         self.addCleanup(os.chdir, os.getcwdu())
         self.makeAndChdirToTestDir()



More information about the bazaar-commits mailing list