sponsor Vim development Vim logo Vim Book Ad

pytestator : simple script to simplify the use of unit test in python

 script karma  Rating 13/4, Downloaded by 629  Comments, bugs, improvements  Vim wiki

created by
Laurent Peuch
 
script type
utility
 
description
This a really simple script to made your life easier if you write unit test in python (you should !).

This script assume that your test file is name test_<other file name>.
Btw, this shouldn't be hard to change

Here are the basic commands:
,tc create the test file - stand for "test create"
,tF force to create a test file (this will be necessary if another file already have the matching name, this file will be destroyed) - "test Force (create)"
,tr run the unittest for this file - stand for "test run"
,s  swap between test file and actual file, if the test file doesn't exist, it will be created - stand for "swap"

You'll be mostly (exclusivly ?) using only ,s and ,tr

Other feature:
- will display a big red stupid message in your statusline if this python file don't have a test file, remove the set statusline+=blabla if you don't want to have it.

If you have comments/bugs repport/feature request/chocolate feel free to send me an email or ping me on irc (psycojoker@irc.freenode.net#vim)

*Not* include in the script, I love those mappings:
imap ,ar self.assertRaises()<left>
imap ,ae self.assertEqual()<left>
imap ,at self.assertTrue()<left>
imap ,af self.assertFalse()<left>
 
install details
Just put the file into ~/.vim/plugin/
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
pytestator.vim 0.1 2010-07-15 7.0 Laurent Peuch Initial upload
ip used for rating: 216.73.216.208

Questions about Vim should go to the maillist. Help Uganda.     Vim at Github