/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 bzrlib/tests/__init__.py

[merge] bzr.dev 2294

Show diffs side-by-side

added added

removed removed

Lines of Context:
1424
1424
                    t.mkdir('.')
1425
1425
                except errors.FileExists:
1426
1426
                    pass
 
1427
            if format is None:
 
1428
                format = 'default'
1427
1429
            if isinstance(format, basestring):
1428
1430
                format = bzrdir.format_registry.make_bzrdir(format)
1429
 
            elif format is None:
1430
 
                format = bzrlib.bzrdir.BzrDirFormat.get_default_format()
1431
1431
            return format.initialize_on_transport(t)
1432
1432
        except errors.UninitializableFormat:
1433
1433
            raise TestSkipped("Format %s is not initializable." % format)
1881
1881
            raise
1882
1882
    for name, plugin in bzrlib.plugin.all_plugins().items():
1883
1883
        if getattr(plugin, 'test_suite', None) is not None:
1884
 
            suite.addTest(plugin.test_suite())
 
1884
            default_encoding = sys.getdefaultencoding()
 
1885
            try:
 
1886
                plugin_suite = plugin.test_suite()
 
1887
            except ImportError, e:
 
1888
                bzrlib.trace.warning(
 
1889
                    'Unable to test plugin "%s": %s', name, e)
 
1890
            else:
 
1891
                suite.addTest(plugin_suite)
 
1892
            if default_encoding != sys.getdefaultencoding():
 
1893
                bzrlib.trace.warning(
 
1894
                    'Plugin "%s" tried to reset default encoding to: %s', name,
 
1895
                    sys.getdefaultencoding())
 
1896
                reload(sys)
 
1897
                sys.setdefaultencoding(default_encoding)
1885
1898
    return suite
1886
1899
 
1887
1900