/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 breezy/doc/api/__init__.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-22 00:56:52 UTC
  • mfrom: (6621.2.26 py3_pokes)
  • Revision ID: jelmer@jelmer.uk-20170522005652-yjahcr9hwmjkno7n
Merge Python3 porting work ('py3 pokes')

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 
32
32
from breezy import tests
33
33
 
 
34
 
 
35
def make_new_test_id(test):
 
36
    new_id = '%s.DocFileTest(%s)' % (__name__, test.id())
 
37
    return lambda: new_id
 
38
 
 
39
 
34
40
def load_tests(basic_tests, module, loader):
35
41
    """This module creates its own test suite with DocFileSuite."""
36
42
 
42
48
    scripts = [candidate for candidate in candidates
43
49
               if candidate.endswith('.txt')]
44
50
    # since this module doesn't define tests, we ignore basic_tests
45
 
    suite = doctest.DocFileSuite(*scripts)
 
51
    suite = doctest.DocFileSuite(*scripts, setUp=tests.isolated_doctest_setUp,
 
52
                                 tearDown=tests.isolated_doctest_tearDown)
46
53
    # DocFileCase reduces the test id to the base name of the tested file, we
47
54
    # want the module to appears there.
48
55
    for t in tests.iter_suite_tests(suite):
49
 
        def make_new_test_id():
50
 
            new_id = '%s.DocFileTest(%s)' % ( __name__, t)
51
 
            return lambda: new_id
52
 
        t.id = make_new_test_id()
 
56
        t.id = make_new_test_id(t)
53
57
    return suite