Rev 2288: Remove some redundant code pointed out by Robert's review, and remove some unused imports while I'm there. in sftp://bazaar.launchpad.net/%7Ebzr/bzr/bzr.dev.hpss.api.changes/

Andrew Bennetts andrew.bennetts at canonical.com
Thu Apr 12 08:38:20 BST 2007


At sftp://bazaar.launchpad.net/%7Ebzr/bzr/bzr.dev.hpss.api.changes/

------------------------------------------------------------
revno: 2288
revision-id: andrew.bennetts at canonical.com-20070412073725-pzd8641vf9oh6v5g
parent: andrew.bennetts at canonical.com-20070412033450-zbjs6vgxmsw6s7ts
committer: Andrew Bennetts <andrew.bennetts at canonical.com>
branch nick: bzr.dev.hpss.api.changes
timestamp: Thu 2007-04-12 17:37:25 +1000
message:
  Remove some redundant code pointed out by Robert's review, and remove some unused imports while I'm there.
modified:
  bzrlib/tests/repository_implementations/test_repository.py test_repository.py-20060131092128-ad07f494f5c9d26c
  bzrlib/tests/test_lockable_files.py test_lockable_files.py-20051225183927-365c7fd99591caf1
=== modified file 'bzrlib/tests/repository_implementations/test_repository.py'
--- a/bzrlib/tests/repository_implementations/test_repository.py	2007-04-11 13:35:32 +0000
+++ b/bzrlib/tests/repository_implementations/test_repository.py	2007-04-12 07:37:25 +0000
@@ -16,31 +16,19 @@
 
 """Tests for bzrdir implementations - tests a bzrdir format."""
 
-import os
 import re
-import sys
 
 import bzrlib
 from bzrlib import (
     bzrdir,
     errors,
-    lockdir,
     repository,
     )
-from bzrlib.branch import Branch, needs_read_lock, needs_write_lock
 from bzrlib.delta import TreeDelta
-from bzrlib.errors import (FileExists,
-                           NoSuchRevision,
-                           NoSuchFile,
-                           UninitializableFormat,
-                           NotBranchError,
-                           )
 from bzrlib.inventory import Inventory, InventoryDirectory
 from bzrlib.revision import NULL_REVISION
-from bzrlib.repofmt import knitrepo
-from bzrlib.tests import TestCase, TestCaseWithTransport, TestSkipped
+from bzrlib.tests import TestCaseWithTransport, TestSkipped
 from bzrlib.tests.bzrdir_implementations.test_bzrdir import TestCaseWithBzrDir
-from bzrlib.trace import mutter
 from bzrlib.transport import get_transport
 from bzrlib.upgrade import upgrade
 from bzrlib.workingtree import WorkingTree
@@ -434,10 +422,6 @@
 
 class TestRepositoryLocking(TestCaseWithRepository):
 
-    def setUp(self):
-        TestCaseWithRepository.setUp(self)
-        self.reduceLockdirTimeout()
-
     def test_leave_lock_in_place(self):
         repo = self.make_repository('r')
         # Lock the repository, then use leave_lock_in_place so that when we
@@ -559,7 +543,7 @@
         self.assertEqual({'rev1':[],
                           'rev2':['rev1']},
                          self.bzrdir.open_repository().get_revision_graph('rev2'))
-        self.assertRaises(NoSuchRevision,
+        self.assertRaises(errors.NoSuchRevision,
                           self.bzrdir.open_repository().get_revision_graph,
                           'orphan')
         # and ghosts are not mentioned

=== modified file 'bzrlib/tests/test_lockable_files.py'
--- a/bzrlib/tests/test_lockable_files.py	2007-04-11 13:35:32 +0000
+++ b/bzrlib/tests/test_lockable_files.py	2007-04-12 07:37:25 +0000
@@ -17,11 +17,9 @@
 from StringIO import StringIO
 
 import bzrlib
-from bzrlib.branch import Branch
 import bzrlib.errors as errors
 from bzrlib.errors import BzrBadParameterNotString, NoSuchFile, ReadOnlyError
 from bzrlib.lockable_files import LockableFiles, TransportLock
-from bzrlib import lockdir
 from bzrlib.lockdir import LockDir
 from bzrlib.tests import TestCaseInTempDir
 from bzrlib.tests.test_transactions import DummyWeave
@@ -35,9 +33,6 @@
 # these tests are applied in each parameterized suite for LockableFiles
 class _TestLockableFiles_mixin(object):
 
-    def setUp(self):
-        self.reduceLockdirTimeout()
-
     def test_read_write(self):
         self.assertRaises(NoSuchFile, self.lockable.get, 'foo')
         self.assertRaises(NoSuchFile, self.lockable.get_utf8, 'foo')
@@ -306,7 +301,6 @@
 
     def setUp(self):
         TestCaseInTempDir.setUp(self)
-        _TestLockableFiles_mixin.setUp(self)
         transport = get_transport('.')
         transport.mkdir('.bzr')
         self.sub_transport = transport.clone('.bzr')
@@ -329,7 +323,6 @@
 
     def setUp(self):
         TestCaseInTempDir.setUp(self)
-        _TestLockableFiles_mixin.setUp(self)
         self.transport = get_transport('.')
         self.lockable = self.get_lockable()
         # the lock creation here sets mode - test_permissions on branch 




More information about the bazaar-commits mailing list