~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/doc/api/__init__.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-01-23 18:01:46 UTC
  • mfrom: (3198.1.1 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20080123180146-9pkott489spjwv8q
(vila) Add --load-list option to selftest

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
import doctest
28
28
import os
29
 
    
 
29
 
 
30
from bzrlib import tests
 
31
 
30
32
def test_suite():
31
33
    dir_ = os.path.dirname(__file__)
32
34
    if os.path.isdir(dir_):
35
37
        candidates = []
36
38
    scripts = [candidate for candidate in candidates
37
39
               if candidate.endswith('.txt')]
38
 
    return doctest.DocFileSuite(*scripts)
 
40
    suite = doctest.DocFileSuite(*scripts)
 
41
    # DocFileCase reduces the test id to the base name of the tested file, we
 
42
    # want the module to appears there.
 
43
    for t in tests.iter_suite_tests(suite):
 
44
        def make_new_test_id():
 
45
            new_id = '%s(%s)' % ( __name__, t)
 
46
            return lambda: new_id
 
47
        t.id = make_new_test_id()
 
48
    return suite