~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to doc/developers/testing.txt

  • Committer: Robert Collins
  • Date: 2010-05-06 23:41:35 UTC
  • mto: This revision was merged to the branch mainline in revision 5223.
  • Revision ID: robertc@robertcollins.net-20100506234135-yivbzczw1sejxnxc
Lock methods on ``Tree``, ``Branch`` and ``Repository`` are now
expected to return an object which can be used to unlock them. This reduces
duplicate code when using cleanups. The previous 'tokens's returned by
``Branch.lock_write`` and ``Repository.lock_write`` are now attributes
on the result of the lock_write. ``repository.RepositoryWriteLockResult``
and ``branch.BranchWriteLockResult`` document this. (Robert Collins)

``log._get_info_for_log_files`` now takes an add_cleanup callable.
(Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
772
772
 
773
773
TestCase
774
774
    A base TestCase that extends the Python standard library's
775
 
    TestCase in several ways.  It adds more assertion methods (e.g.
776
 
    ``assertContainsRe``), ``addCleanup``, and other features (see its API
777
 
    docs for details).  It also has a ``setUp`` that makes sure that
778
 
    global state like registered hooks and loggers won't interfere with
779
 
    your test.  All tests should use this base class (whether directly or
780
 
    via a subclass).
 
775
    TestCase in several ways.  TestCase is build on
 
776
    ``testtools.TestCase``, which gives it support for more assertion
 
777
    methods (e.g.  ``assertContainsRe``), ``addCleanup``, and other
 
778
    features (see its API docs for details).  It also has a ``setUp`` that
 
779
    makes sure that global state like registered hooks and loggers won't
 
780
    interfere with your test.  All tests should use this base class
 
781
    (whether directly or via a subclass).  Note that we are trying not to
 
782
    add more assertions at this point, and instead to build up a library
 
783
    of ``bzrlib.tests.matchers``.
781
784
 
782
785
TestCaseWithMemoryTransport
783
786
    Extends TestCase and adds methods like ``get_transport``,