| Conditions | 1 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | from __future__ import absolute_import |
||
| 38 | def trace(self, predicate): |
||
| 39 | """ |
||
| 40 | Starts tracing. Can be used as a context manager (with slightly incorrect semantics - it starts tracing |
||
| 41 | before ``__enter__`` is |
||
| 42 | called). |
||
| 43 | |||
| 44 | Args: |
||
| 45 | predicates (:class:`hunter.Q` instances): Runs actions if any of the given predicates match. |
||
| 46 | options: Keyword arguments that are passed to :class:`hunter.Q`, for convenience. |
||
| 47 | """ |
||
| 48 | self._handler = predicate |
||
| 49 | sys.settrace(self) |
||
| 50 | return self |
||
| 51 | |||
| 64 |