~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test__rio.py

Change all of the compiled_foo to compiled_foo_feature

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2009 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
23
23
 
24
24
 
25
25
def load_tests(standard_tests, module, loader):
26
 
    suite, _ = tests.permute_tests_for_extension(standard_tests, loader,
27
 
        'bzrlib._rio_py', 'bzrlib._rio_pyx')
 
26
    # parameterize all tests in this module
 
27
    suite = loader.suiteClass()
 
28
    import bzrlib._rio_py as py_module
 
29
    scenarios = [('python', {'module': py_module})]
 
30
    if compiled_rio_feature.available():
 
31
        scenarios.append(('C', {'module': compiled_rio_feature.module}))
 
32
    else:
 
33
        # the compiled module isn't available, so we add a failing test
 
34
        class FailWithoutFeature(tests.TestCase):
 
35
            def test_fail(self):
 
36
                self.requireFeature(compiled_rio_feature)
 
37
        suite.addTest(loader.loadTestsFromTestCase(FailWithoutFeature))
 
38
    tests.multiply_tests(standard_tests, scenarios, suite)
28
39
    return suite
29
40
 
30
41
 
 
42
compiled_rio_feature = tests.ModuleAvailableFeature('bzrlib._rio_pyx')
 
43
 
 
44
 
31
45
class TestValidTag(tests.TestCase):
32
46
 
33
47
    module = None # Filled in by test parameterization