~bzr/bzr/bzr.1.5

« back to all changes in this revision

Viewing changes to bzrlib/tests/repository_implementations/__init__.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-05-08 23:03:13 UTC
  • mfrom: (3394.3.2 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20080508230313-knn3ibom6wt27w5k
(vila) Make the test suite use the new test loader

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
                          multiply_scenarios,
44
44
                          multiply_tests_from_modules,
45
45
                          TestScenarioApplier,
46
 
                          TestLoader,
47
 
                          TestSuite,
48
46
                          )
49
47
from bzrlib.tests.bzrdir_implementations.test_bzrdir import TestCaseWithBzrDir
50
48
from bzrlib.transport.memory import MemoryServer
834
832
    ]
835
833
    
836
834
 
837
 
def test_suite():
 
835
def load_tests(basic_tests, module, loader):
 
836
    result = loader.suiteClass()
 
837
    # add the tests for this module
 
838
    result.addTests(basic_tests)
 
839
 
838
840
    registry = repository.format_registry
839
841
    all_formats = [registry.get(k) for k in registry.keys()]
840
842
    all_formats.extend(weaverepo._legacy_formats)
881
883
    module_name_list = [prefix + module_name
882
884
                        for module_name in test_repository_modules]
883
885
 
 
886
    # add the tests for the sub modules
 
887
 
884
888
    # Parameterize repository_implementations test modules by format.
885
 
    result = multiply_tests_from_modules(module_name_list, format_scenarios)
 
889
    result.addTests(multiply_tests_from_modules(module_name_list,
 
890
                                                format_scenarios,
 
891
                                                loader))
886
892
 
887
893
    # test_check_reconcile needs to be parameterized by format *and* by broken
888
894
    # repository scenario.
892
898
        format_scenarios, broken_scenarios)
893
899
    broken_scenario_applier = TestScenarioApplier()
894
900
    broken_scenario_applier.scenarios = broken_scenarios_for_all_formats
895
 
    loader = TestLoader()
896
901
    adapt_modules(
897
902
        [prefix + 'test_check_reconcile'],
898
903
        broken_scenario_applier, loader, result)