/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to doc/developers/testing.txt

  • Committer: Jelmer Vernooij
  • Date: 2010-03-22 13:59:33 UTC
  • mfrom: (5105 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5106.
  • Revision ID: jelmer@samba.org-20100322135933-7i7vyau8mvjoqvpf
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
455
455
  unless there is a good reason
456
456
 
457
457
 
 
458
Testing locking behaviour
 
459
-------------------------
 
460
 
 
461
You may want to write tests that particular objects are or aren't locked
 
462
during particular operations: see for example `bug 498409`__.  
 
463
 
 
464
 __ https://launchpad.net/bugs/498409
 
465
 
 
466
The `TestCase` base class registers hooks that record lock actions into 
 
467
``._lock_actions`` in this format::
 
468
 
 
469
  [
 
470
    ('acquired', LockResult(file:///tmp/testbzr-J2pcy2.tmp/.bzr/branch-lockc4au55ppz8wdym11z1aq)),
 
471
    ('released', LockResult(file:///tmp/testbzr-J2pcy2.tmp/.bzr/branch-lockc4au55ppz8wdym11z1aq)),
 
472
    ('acquired', LockResult(file:///tmp/testbzr-J2pcy2.tmp/.bzr/repository/lockyxb3rn4sw1oyx1jzkt45)),
 
473
    ('released', LockResult(file:///tmp/testbzr-J2pcy2.tmp/.bzr/repository/lockyxb3rn4sw1oyx1jzkt45)),
 
474
    ('acquired', LockResult(file:///tmp/testbzr-J2pcy2.tmp/.bzr/branch/lockh8c6t28rcjdkgxtndbje)),
 
475
    ('released', LockResult(file:///tmp/testbzr-J2pcy2.tmp/.bzr/branch/lockh8c6t28rcjdkgxtndbje)),
 
476
    ...
 
477
 
 
478
Alternatively you can register your own hooks to make custom assertions:
 
479
see `TestCase._check_locks` for an example.
 
480
 
458
481
Skipping tests
459
482
--------------
460
483