[TIP] [ANN] pytest.vim (py.test and vim integration)

Alfredo Deza alfredodeza at gmail.com
Fri Jan 28 09:40:10 PST 2011


After talking a bit with Holger yesterday I went ahead and got a VIM
plugin working that integrates py.test into the editor.

Link: http://www.vim.org/scripts/script.php?script_id=3424

You can basically run tests for the:

* current class
* current method
* current file

When tests pass you get a green bar at the bottom of your session:

And when you fail you get a red bar but also the line numbers of all the
failed test errors along with the errors:

This is handy if you are trying to do something along the "red, green,
testing style.

I grabbed a couple of Gary Bernhardt's functions living in his .vimrc (mostly
for the green and red bars) and was also inspired to see his own version
of this setup working in a KataCast a while ago:

If there are any VIM + py.test users I am sure you will find useful the idea of
not having to move back and forth from the editor to the terminal.

I am expecting bugs and issues so feel free to bug me about them in
the issue tracker:


And the project itself lives in GitHub:


More information about the testing-in-python mailing list