[TIP] Dingus screencast and source code
gary.bernhardt at gmail.com
Wed Apr 1 19:31:13 PDT 2009
On Wed, Apr 1, 2009 at 12:57 PM, Marius Gedminas <marius at gedmin.as> wrote:
> On Tue, Mar 31, 2009 at 10:25:24PM -0400, Gary Bernhardt wrote:
> Now I normally *hate* screencasts with a passion (most of them would be
> improved by replacing them with a typed-in transcript), but this one is
> simply *awesome*.
> I cannot say I fell in love with Dingus (my experiments with magic mocks
> ended up badly when they pretended to have special attributes that Zope 3
> interprets in special ways), but I'm impressed by your workflow.
Understandable. Dingus used to have a bad interaction of this sort
with IPython. These things seem rare though (the IPython one is
fixed), and I think it's worth it. :)
> What do you use to integrate nose with vim?
There are a few of pieces:
* The nose_machineout plugin makes nose output errors in a way
that's roughly compatible with make's output.
* Vim's :make command knows how to parse make output. This is how it
jumps me to the correct line.
* Vim provides a list of compile errors via getqflist(), which I use
to get at the error text.
Combine all of that with "set switchbuf=useopen" and vim will
automatically jump your cursor to the erroring line, even across
splits. All of this is available in my .vimrc  on BitBucket. Find
the <leader>m remap (and the ones below it) and go from there. I am
definitely not a very advanced vim scripter, so please forgive any
syntactic badness in my vimrc. :)
More information about the testing-in-python