Home Download Buy Blog Forum Support

Automated Testing of Plugins

Automated Testing of Plugins

Postby SteveCooperOrg on Fri Jun 20, 2008 11:08 pm

Hi, All. Anyone tried writing automated tests for sublime plugins?

I've never done unit testing in python, and so I'm not sure quite how to go about it. What I'd like to do is something like this;

1) be able to develop the files as normal, dropping python into package folders.
2) also embed tests, which only run when you press 'F7'

I assume I'm going to need some mock objects representing Sublime views, windows, etc. Anyone tried anything like this, and have some pointers?
Maybe what you're looking for is at the http://www.sublimetextwiki.com
SteveCooperOrg
 
Posts: 193
Joined: Thu Mar 20, 2008 9:53 am

Re: Automated Testing of Plugins

Postby jps on Mon Jun 23, 2008 1:34 pm

I haven't tried it, but I expect you could create some modules called sublime and sublimeplugin with the mock objects, and place them in the system python path, such that they'd be available to stand alone python (i.e., when run via F7), but wouldn't be visible when loaded via Sublime Text.

Python's unit testing library (http://docs.python.org/lib/minimal-example.html) is pretty easy to work with.
jps
Site Admin
 
Posts: 3071
Joined: Wed Mar 19, 2008 12:33 pm


Return to Plugin Announcements

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 10 guests