~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to doc/developers/testing.txt

Merge bzr.dev into cleanup

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
 
576
599
 - UnicodeFilenameFeature
577
600
 - FTPServerFeature
578
601
 - 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.
579
606
 
580
607
 
581
608
Defining a new feature that tests can require