~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
811
811
        self.assertEndsWith('foo', 'oo')
812
812
        self.assertRaises(AssertionError, self.assertEndsWith, 'o', 'oo')
813
813
 
814
 
    def test_assertDeprecated(self):
 
814
    def test_callDeprecated(self):
815
815
        def testfunc(be_deprecated, result=None):
816
816
            if be_deprecated is True:
817
817
                symbol_versioning.warn('i am deprecated', DeprecationWarning, 
818
818
                                       stacklevel=1)
819
819
            return result
820
 
        result = self.assertDeprecated(['i am deprecated'], testfunc, True)
 
820
        result = self.callDeprecated(['i am deprecated'], testfunc, True)
821
821
        self.assertIs(None, result)
822
 
        result = self.assertDeprecated([], testfunc, False, 'result')
 
822
        result = self.callDeprecated([], testfunc, False, 'result')
823
823
        self.assertEqual('result', result)
824
 
        self.assertDeprecated(['i am deprecated'], testfunc, 
 
824
        self.callDeprecated(['i am deprecated'], testfunc, 
825
825
                              be_deprecated=True)
826
 
        self.assertDeprecated([], testfunc, be_deprecated=False)
 
826
        self.callDeprecated([], testfunc, be_deprecated=False)
827
827
 
828
828
 
829
829
class TestConvenienceMakers(TestCaseWithTransport):