The name lookup interception logic in Mock could be used with pdb e.g.
patch.pdb('x.y.z')
could hook a pdb.set_trace() call in to z
Possible options:
- trace when z is resolved
- trace when z is called
- trace on attribute/index access on z
This would allow you to set pdb traces from console (or tests) without having
to open and edit the source, which is a) is convenient, b) performant (no
source recompilation), and c) prevents you from accidentally committing
set_trace() statements in your code :)
Not strictly to do with mocking, but uses the intercept logic.
Wild idea: If this is done and useful, might even be worth splitting out Mock's
name interception into another package, so other tools could use it?
Original issue reported on code.google.com by bloodear...@gmail.com on 27 Sep 2011 at 4:26
Original issue reported on code.google.com by
bloodear...@gmail.com
on 27 Sep 2011 at 4:26