/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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-08-22 17:02:22 UTC
  • mfrom: (1551.8.8 Aaron's mergeable stuff)
  • Revision ID: pqm@pqm.ubuntu.com-20060822170222-c5f47d2de719bc8d
Made assertDeprecated return the callable's result

Show diffs side-by-side

added added

removed removed

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