/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

Bring in bzr.dev 4005

Show diffs side-by-side

added added

removed removed

Lines of Context:
808
808
            bzrlib.mutabletree.MutableTree: bzrlib.mutabletree.MutableTree.hooks,
809
809
            bzrlib.smart.client._SmartClient: bzrlib.smart.client._SmartClient.hooks,
810
810
            bzrlib.smart.server.SmartTCPServer: bzrlib.smart.server.SmartTCPServer.hooks,
 
811
            bzrlib.commands.Command: bzrlib.commands.Command.hooks,
811
812
            }
812
813
        self.addCleanup(self._restoreHooks)
813
814
        # reset all hooks to an empty instance of the appropriate type
814
815
        bzrlib.branch.Branch.hooks = bzrlib.branch.BranchHooks()
815
816
        bzrlib.smart.client._SmartClient.hooks = bzrlib.smart.client.SmartClientHooks()
816
817
        bzrlib.smart.server.SmartTCPServer.hooks = bzrlib.smart.server.SmartServerHooks()
 
818
        bzrlib.commands.Command.hooks = bzrlib.commands.CommandHooks()
817
819
 
818
820
    def _silenceUI(self):
819
821
        """Turn off UI for duration of test"""
2485
2487
              list_only=False,
2486
2488
              random_seed=None,
2487
2489
              exclude_pattern=None,
2488
 
              strict=False):
 
2490
              strict=False,
 
2491
              runner_class=None):
 
2492
    """Run a test suite for bzr selftest.
 
2493
 
 
2494
    :param runner_class: The class of runner to use. Must support the
 
2495
        constructor arguments passed by run_suite which are more than standard
 
2496
        python uses.
 
2497
    :return: A boolean indicating success.
 
2498
    """
2489
2499
    TestCase._gather_lsprof_in_benchmarks = lsprof_timed
2490
2500
    if verbose:
2491
2501
        verbosity = 2
2492
2502
    else:
2493
2503
        verbosity = 1
2494
 
    runner = TextTestRunner(stream=sys.stdout,
 
2504
    if runner_class is None:
 
2505
        runner_class = TextTestRunner
 
2506
    runner = runner_class(stream=sys.stdout,
2495
2507
                            descriptions=0,
2496
2508
                            verbosity=verbosity,
2497
2509
                            bench_history=bench_history,
2553
2565
             load_list=None,
2554
2566
             debug_flags=None,
2555
2567
             starting_with=None,
 
2568
             runner_class=None,
2556
2569
             ):
2557
2570
    """Run the whole test suite under the enhanced runner"""
2558
2571
    # XXX: Very ugly way to do this...
2588
2601
                     list_only=list_only,
2589
2602
                     random_seed=random_seed,
2590
2603
                     exclude_pattern=exclude_pattern,
2591
 
                     strict=strict)
 
2604
                     strict=strict,
 
2605
                     runner_class=runner_class,
 
2606
                     )
2592
2607
    finally:
2593
2608
        default_transport = old_transport
2594
2609
        selftest_debug_flags = old_debug_flags
2876
2891
                   'bzrlib.tests.test_shelf_ui',
2877
2892
                   'bzrlib.tests.test_smart',
2878
2893
                   'bzrlib.tests.test_smart_add',
 
2894
                   'bzrlib.tests.test_smart_request',
2879
2895
                   'bzrlib.tests.test_smart_transport',
2880
2896
                   'bzrlib.tests.test_smtp_connection',
2881
2897
                   'bzrlib.tests.test_source',