[CentralOH] Unittesting with vi(m)

Eric Wilson wilson.eric.n at gmail.com
Wed Nov 2 00:44:18 CET 2011


Eventually, you may want to look into nosetests. It will find and execute
all tests in all test files, based on naming conventions.

Eric Wilson

On Tue, Nov 1, 2011 at 5: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/20111101/2ba48dca/attachment.html>


More information about the CentralOH mailing list