~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test__annotator.py

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

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
def load_tests(standard_tests, module, loader):
30
30
    """Parameterize tests for all versions of groupcompress."""
31
 
    scenarios = [
32
 
        ('python', {'module': _annotator_py}),
33
 
    ]
34
 
    suite = loader.suiteClass()
35
 
    if compiled_annotator_feature.available():
36
 
        scenarios.append(('C', {'module': compiled_annotator_feature.module}))
37
 
    else:
38
 
        # the compiled module isn't available, so we add a failing test
39
 
        class FailWithoutFeature(tests.TestCase):
40
 
            def test_fail(self):
41
 
                self.requireFeature(compiled_annotator_feature)
42
 
        suite.addTest(loader.loadTestsFromTestCase(FailWithoutFeature))
43
 
    result = tests.multiply_tests(standard_tests, scenarios, suite)
44
 
    return result
45
 
 
46
 
 
47
 
compiled_annotator_feature = tests.ModuleAvailableFeature(
48
 
                                'bzrlib._annotator_pyx')
 
31
    suite, _ = tests.permute_tests_for_extension(standard_tests, loader,
 
32
        'bzrlib._annotator_py', 'bzrlib._annotator_pyx')
 
33
    return suite
49
34
 
50
35
 
51
36
class TestAnnotator(tests.TestCaseWithMemoryTransport):