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

Made assertDeprecated return the callable's result

Show diffs side-by-side

added added

removed removed

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