~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/fixtures.py

  • Committer: Vincent Ladeuil
  • Date: 2010-06-29 16:21:13 UTC
  • mfrom: (5325 +trunk)
  • mto: (5247.1.12 first-try)
  • mto: This revision was merged to the branch mainline in revision 5326.
  • Revision ID: v.ladeuil+lp@free.fr-20100629162113-xa6y33u17mfi024v
Merge bzr.dev into cleanup resolving conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
    else:
83
83
        e = [n for (n, u) in interesting_encodings]
84
84
    return itertools.cycle(iter(e))
 
85
 
 
86
 
 
87
class RecordingContextManager(object):
 
88
    """A context manager that records."""
 
89
 
 
90
    def __init__(self):
 
91
        self._calls = []
 
92
 
 
93
    def __enter__(self):
 
94
        self._calls.append('__enter__')
 
95
        return self # This is bound to the 'as' clause in a with statement.
 
96
 
 
97
    def __exit__(self, exc_type, exc_val, exc_tb):
 
98
        self._calls.append('__exit__')
 
99
        return False # propogate exceptions.