(self, text)
| 164 | |
| 165 | @contextmanager |
| 166 | def context(self, text): |
| 167 | if text is not None: |
| 168 | self.add('with %s:' % text) |
| 169 | self._indent += 4 |
| 170 | self._lines_in_context.append(0) |
| 171 | try: |
| 172 | yield |
| 173 | finally: |
| 174 | if text is not None: |
| 175 | if self._lines_in_context[-1] == 0: |
| 176 | self.add('pass') |
| 177 | self._indent -= 4 |
| 178 | del self._lines_in_context[-1] |
| 179 | |
| 180 | def add(self, text): |
| 181 | self._lines_in_context[-1] += 1 |
no test coverage detected