/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: Vincent Ladeuil
  • Date: 2010-10-13 07:55:13 UTC
  • mfrom: (5492 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5501.
  • Revision ID: v.ladeuil+lp@free.fr-20101013075513-hil6q8xi7i9e3ozq
Merge bzr.dev fixing NEWS entry

Show diffs side-by-side

added added

removed removed

Lines of Context:
388
388
If you want the command to succeed for any output, just use::
389
389
 
390
390
  $ bzr add file
 
391
  ...
 
392
  2>...
 
393
 
 
394
or use the ``--quiet`` option::
 
395
 
 
396
  $ bzr add -q file
391
397
 
392
398
The following will stop with an error::
393
399
 
811
817
whether a test should be added for that particular implementation,
812
818
or for all implementations of the interface.
813
819
 
814
 
The multiplication of tests for different implementations is normally
815
 
accomplished by overriding the ``load_tests`` function used to load tests
816
 
from a module.  This function typically loads all the tests, then applies
817
 
a TestProviderAdapter to them, which generates a longer suite containing
818
 
all the test variations.
819
 
 
820
820
See also `Per-implementation tests`_ (above).
821
821
 
822
822
 
823
 
Test scenarios
824
 
--------------
 
823
Test scenarios and variations
 
824
-----------------------------
825
825
 
826
826
Some utilities are provided for generating variations of tests.  This can
827
827
be used for per-implementation tests, or other cases where the same test
832
832
values to which the test should be applied.  The test suite should then
833
833
also provide a list of scenarios in which to run the tests.
834
834
 
835
 
Typically ``multiply_tests_from_modules`` should be called from the test
836
 
module's ``load_tests`` function.
 
835
A single *scenario* is defined by a `(name, parameter_dict)` tuple.  The
 
836
short string name is combined with the name of the test method to form the
 
837
test instance name.  The parameter dict is merged into the instance's
 
838
attributes.
 
839
 
 
840
For example::
 
841
 
 
842
    load_tests = load_tests_apply_scenarios
 
843
 
 
844
    class TestCheckout(TestCase):
 
845
 
 
846
    variations = multiply_scenarios(
 
847
        VaryByRepositoryFormat(), 
 
848
        VaryByTreeFormat(),
 
849
        )
 
850
 
 
851
The `load_tests` declaration or definition should be near the top of the
 
852
file so its effect can be seen.
837
853
 
838
854
 
839
855
Test support