~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: John Arbash Meinel
  • Date: 2006-06-26 16:31:49 UTC
  • mfrom: (1813 +trunk)
  • mto: (1711.7.2 win32)
  • mto: This revision was merged to the branch mainline in revision 1822.
  • Revision ID: john@arbash-meinel.com-20060626163149-2213f2f2d895829d
[merge] bzr.dev 1813

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
import codecs
30
30
from cStringIO import StringIO
31
31
import difflib
 
32
import doctest
32
33
import errno
33
34
import logging
34
35
import os
69
70
from bzrlib.transport.local import LocalRelpathServer
70
71
from bzrlib.transport.readonly import ReadonlyServer
71
72
from bzrlib.trace import mutter
72
 
from bzrlib.tests.TestUtil import TestLoader, TestSuite
 
73
from bzrlib.tests import TestUtil
 
74
from bzrlib.tests.TestUtil import (
 
75
                          TestSuite,
 
76
                          TestLoader,
 
77
                          )
73
78
from bzrlib.tests.treeshape import build_tree_contents
74
79
import bzrlib.urlutils as urlutils
75
80
from bzrlib.workingtree import WorkingTree, WorkingTreeFormat2
684
689
        self.log('run bzr: %r', argv)
685
690
        # FIXME: don't call into logging here
686
691
        handler = logging.StreamHandler(stderr)
687
 
        handler.setFormatter(bzrlib.trace.QuietFormatter())
688
692
        handler.setLevel(logging.INFO)
689
693
        logger = logging.getLogger('')
690
694
        logger.addHandler(handler)
1137
1141
 
1138
1142
 
1139
1143
def filter_suite_by_re(suite, pattern):
1140
 
    result = TestSuite()
 
1144
    result = TestUtil.TestSuite()
1141
1145
    filter_re = re.compile(pattern)
1142
1146
    for test in iter_suite_tests(suite):
1143
1147
        if filter_re.search(test.id()):
1198
1202
    This function can be replaced if you need to change the default test
1199
1203
    suite on a global basis, but it is not encouraged.
1200
1204
    """
1201
 
    from doctest import DocTestSuite
1202
 
 
1203
 
    global MODULES_TO_DOCTEST
1204
 
 
1205
 
    testmod_names = [ \
 
1205
    testmod_names = [
1206
1206
                   'bzrlib.tests.test_ancestry',
1207
1207
                   'bzrlib.tests.test_api',
1208
1208
                   'bzrlib.tests.test_bad_files',
1282
1282
        'bzrlib.tests.test_transport_implementations',
1283
1283
        'bzrlib.tests.test_read_bundle',
1284
1284
        ]
1285
 
 
1286
 
    suite = TestSuite()
 
1285
    suite = TestUtil.TestSuite()
1287
1286
    loader = TestUtil.TestLoader()
1288
1287
    from bzrlib.transport import TransportTestProviderAdapter
1289
1288
    adapter = TransportTestProviderAdapter()
1293
1292
        suite.addTest(package.test_suite())
1294
1293
    for m in MODULES_TO_TEST:
1295
1294
        suite.addTest(loader.loadTestsFromModule(m))
1296
 
    for m in (MODULES_TO_DOCTEST):
1297
 
        suite.addTest(DocTestSuite(m))
 
1295
    for m in MODULES_TO_DOCTEST:
 
1296
        suite.addTest(doctest.DocTestSuite(m))
1298
1297
    for name, plugin in bzrlib.plugin.all_plugins().items():
1299
1298
        if getattr(plugin, 'test_suite', None) is not None:
1300
1299
            suite.addTest(plugin.test_suite())