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

  • Committer: John Arbash Meinel
  • Date: 2009-12-22 16:28:47 UTC
  • mto: This revision was merged to the branch mainline in revision 4922.
  • Revision ID: john@arbash-meinel.com-20091222162847-tvnsc69to4l4uf5r
Implement a permute_for_extension helper.

Use it for all of the 'simple' extension permutations.
It basically permutes all tests in the current module, by setting TestCase.module.
Which works well for most of our extension tests. Some had more advanced
handling of permutations (extra permutations, custom vars, etc.)

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)
 
31
    suite, _ = tests.permute_tests_for_extension(standard_tests, loader,
 
32
        'bzrlib._annotator_py', 'bzrlib._annotator_pyx')
44
33
    return result
45
34
 
46
35
 
47
 
compiled_annotator_feature = tests.ModuleAvailableFeature(
48
 
                                'bzrlib._annotator_pyx')
49
 
 
50
 
 
51
36
class TestAnnotator(tests.TestCaseWithMemoryTransport):
52
37
 
53
38
    module = None # Set by load_tests