[CentralOH] Unittesting with vi(m)

Austin Godber godber at gmail.com
Thu Nov 3 01:25:46 CET 2011


It seems to me you can solve this by just typing:

:! python filename.py

in any of the windows.  Referencing the file seems somewhat more natural
than remembering the mapping between buffers and files.  Or am I missing

Also, I came across this recently ... for VIM + Python users, I haven't
tried it yet:



On Tue, Nov 1, 2011 at 2:01 PM, Mark Erbaugh <mark at microenh.com> wrote:

> So I'm using Test Driven Development. I have vim open with two side by
> side windows. One window has the code under test, the other the unit tests.
> I have a code runner under the if __name__ == '__main__': section of the
> unit test file.  I can quickly run my unit tests by switching to that
> window (ctrl-W W) and doing :! python %.
> I think it would be smoother if I could execute python with the unit test
> file regardless of which window is active.  Of course I could specify the
> path to the unittest file, but that's awkward. The next best solution would
> be to create a quick map (which is what I'll probably do if I don't come up
> with something better).
> But I wonder if there is a way to specify a file by buffer number as the
> argument to :! python instead of % (for the current buffer)?
> Thanks,
> Mark
> _______________________________________________
> CentralOH mailing list
> CentralOH at python.org
> http://mail.python.org/mailman/listinfo/centraloh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/mailman/private/centraloh/attachments/20111102/2dd30089/attachment.html>

More information about the CentralOH mailing list