~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test__chunks_to_lines.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-03-09 08:45:56 UTC
  • mfrom: (4084.5.2 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090309084556-9i2m12qlud2qcrtw
(robertc) Bulk update all test adaptation into a single approach
        using multiply_tests rather than many varied test adapters.
        (Robert Collins

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
def load_tests(standard_tests, module, loader):
24
24
    # parameterize all tests in this module
25
 
    suite = loader.suiteClass()
26
 
    applier = tests.TestScenarioApplier()
27
25
    import bzrlib._chunks_to_lines_py as py_module
28
 
    applier.scenarios = [('python', {'module': py_module})]
 
26
    scenarios = [('python', {'module': py_module})]
29
27
    if CompiledChunksToLinesFeature.available():
30
28
        import bzrlib._chunks_to_lines_pyx as c_module
31
 
        applier.scenarios.append(('C', {'module': c_module}))
 
29
        scenarios.append(('C', {'module': c_module}))
32
30
    else:
33
31
        # the compiled module isn't available, so we add a failing test
34
32
        class FailWithoutFeature(tests.TestCase):
35
33
            def test_fail(self):
36
34
                self.requireFeature(CompiledChunksToLinesFeature)
37
 
        suite.addTest(loader.loadTestsFromTestCase(FailWithoutFeature))
38
 
    tests.adapt_tests(standard_tests, applier, suite)
39
 
    return suite
 
35
        standard_tests.addTest(FailWithoutFeature("test_fail"))
 
36
    return tests.multiply_tests(standard_tests, scenarios, loader.suiteClass())
40
37
 
41
38
 
42
39
class _CompiledChunksToLinesFeature(tests.Feature):