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 CompiledChkMapFeature.available():
33
import bzrlib._chk_map_pyx as c_module
34
scenarios.append(('C', {'module': c_module}))
36
# the compiled module isn't available, so we add a failing test
37
class FailWithoutFeature(tests.TestCase):
39
self.requireFeature(CompiledChkMapFeature)
40
suite.addTest(loader.loadTestsFromTestCase(FailWithoutFeature))
41
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')
45
class _CompiledChkMapFeature(tests.Feature):
49
import bzrlib._chk_map_pyx
54
def feature_name(self):
55
return 'bzrlib._chk_map_pyx'
57
CompiledChkMapFeature = _CompiledChkMapFeature()
60
33
class TestSearchKeys(tests.TestCase):
62
35
module = None # Filled in by test parameterization