pytestator


Ⅰ. 插件描述

simple script to simplify the use of unit test in python

Ⅱ. 基本信息

创建日期:  2010-07-15
使用用户:  1
Github星:  1
插件作者:  Laurent Peuch

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin '/pytestator'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle '/pytestator'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug '/pytestator'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/vim-scripts/pytestator

Ⅳ. 文档说明

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>

添加新评论