/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/test__chk_map.py

(jam) Add bzrlib.tests.permute_for_extension to simplify extension
        testing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
 
27
27
def load_tests(standard_tests, module, loader):
28
 
    # parameterize all tests in this module
29
 
    suite = loader.suiteClass()
30
 
    import bzrlib._chk_map_py as py_module
31
 
    scenarios = [('python', {'module': py_module})]
32
 
    if compiled_chkmap_feature.available():
33
 
        scenarios.append(('C', {'module': compiled_chkmap_feature.module}))
34
 
    else:
35
 
        # the compiled module isn't available, so we add a failing test
36
 
        class FailWithoutFeature(tests.TestCase):
37
 
            def test_fail(self):
38
 
                self.requireFeature(compiled_chkmap_feature)
39
 
        suite.addTest(loader.loadTestsFromTestCase(FailWithoutFeature))
40
 
    tests.multiply_tests(standard_tests, scenarios, suite)
 
28
    suite, _ = tests.permute_tests_for_extension(standard_tests, loader,
 
29
        'bzrlib._chk_map_py', 'bzrlib._chk_map_pyx')
41
30
    return suite
42
31
 
43
32
 
44
 
compiled_chkmap_feature = tests.ModuleAvailableFeature('bzrlib._chk_map_pyx')
45
 
 
46
 
 
47
33
class TestSearchKeys(tests.TestCase):
48
34
 
49
35
    module = None # Filled in by test parameterization