~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_groupcompress.py

  • Committer: Martin Pool
  • Date: 2010-12-09 04:26:53 UTC
  • mto: This revision was merged to the branch mainline in revision 5564.
  • Revision ID: mbp@canonical.com-20101209042653-hgy6vkrlfvi1d7rs
Change to using standard load_tests_apply_scenarios.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
    )
31
31
from bzrlib.osutils import sha_string
32
32
from bzrlib.tests.test__groupcompress import compiled_groupcompress_feature
33
 
 
34
 
 
35
 
def load_tests(standard_tests, module, loader):
36
 
    """Parameterize tests for all versions of groupcompress."""
37
 
    to_adapt, result = tests.split_suite_by_condition(
38
 
        standard_tests, tests.condition_isinstance(TestAllGroupCompressors))
 
33
from bzrlib.tests.scenarios import load_tests_apply_scenarios
 
34
 
 
35
 
 
36
def group_compress_implementation_scenarios():
39
37
    scenarios = [
40
38
        ('python', {'compressor': groupcompress.PythonGroupCompressor}),
41
39
        ]
42
40
    if compiled_groupcompress_feature.available():
43
41
        scenarios.append(('C',
44
42
            {'compressor': groupcompress.PyrexGroupCompressor}))
45
 
    return tests.multiply_tests(to_adapt, scenarios, result)
 
43
    return scenarios
 
44
 
 
45
 
 
46
load_tests = load_tests_apply_scenarios
46
47
 
47
48
 
48
49
class TestGroupCompressor(tests.TestCase):
66
67
class TestAllGroupCompressors(TestGroupCompressor):
67
68
    """Tests for GroupCompressor"""
68
69
 
69
 
    compressor = None # Set by multiply_tests
 
70
    scenarios = group_compress_implementation_scenarios()
 
71
    compressor = None # Set by scenario
70
72
 
71
73
    def test_empty_delta(self):
72
74
        compressor = self.compressor()