~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to doc/developers/testing.txt

  • Committer: Andrew Bennetts
  • Date: 2010-03-11 04:33:41 UTC
  • mfrom: (4797.33.4 2.1)
  • mto: This revision was merged to the branch mainline in revision 5082.
  • Revision ID: andrew.bennetts@canonical.com-20100311043341-rzdik83fnactjsxs
Merge lp:bzr/2.1, including fixes for #496813, #526211, #526353.

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
 
 
481
458
Skipping tests
482
459
--------------
483
460
 
599
576
 - UnicodeFilenameFeature
600
577
 - FTPServerFeature
601
578
 - CaseInsensitiveFilesystemFeature.
602
 
 - chown_feature: The test can rely on OS being POSIX and python
603
 
   supporting os.chown.
604
 
 - posix_permissions_feature: The test can use POSIX-style
605
 
   user/group/other permission bits.
606
579
 
607
580
 
608
581
Defining a new feature that tests can require