~amanica/bzr/320119-log_exclusive_lower_bound

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Johan Walles
  • Date: 2009-05-06 05:36:28 UTC
  • mfrom: (4332 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4343.
  • Revision ID: johan.walles@gmail.com-20090506053628-tbf1wz4a0m9t684g
MergeĀ fromĀ upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
782
782
    _gather_lsprof_in_benchmarks = False
783
783
    attrs_to_keep = ('id', '_testMethodName', '_testMethodDoc',
784
784
                     '_log_contents', '_log_file_name', '_benchtime',
785
 
                     '_TestCase__testMethodName')
 
785
                     '_TestCase__testMethodName', '_TestCase__testMethodDoc',)
786
786
 
787
787
    def __init__(self, methodName='testMethod'):
788
788
        super(TestCase, self).__init__(methodName)
1446
1446
                raise
1447
1447
        finally:
1448
1448
            saved_attrs = {}
1449
 
            absent_attr = object()
1450
1449
            for attr_name in self.attrs_to_keep:
1451
 
                attr = getattr(self, attr_name, absent_attr)
1452
 
                if attr is not absent_attr:
1453
 
                    saved_attrs[attr_name] = attr
 
1450
                if attr_name in self.__dict__:
 
1451
                    saved_attrs[attr_name] = self.__dict__[attr_name]
1454
1452
            self.__dict__ = saved_attrs
1455
1453
 
1456
1454
    def tearDown(self):