Reader small image

You're reading from  Mastering Sublime Text

Product typeBook
Published inDec 2013
PublisherPackt
ISBN-139781849698429
Edition1st Edition
Right arrow
Author (1)
Dan Peleg
Dan Peleg
author image
Dan Peleg

Dan Peleg is an accomplished software engineer. As a former developer in the Israeli Intelligence Force, he holds extensive experience in both defense and robotic industries, and has previously lectured at DefCon conventions. Dan has developed unique algorithms for robotic platforms, specializes in a variety of software platforms, and currently works as the CTO for an American startup company.
Read more about Dan Peleg

Right arrow

Testing in Python development


Python offers us unittest, an official unit testing framework for Python, sometimes referred as PyUnit. It's like a Python version of JUnit for Java and written by Kent Beck and Erich Gamma.

Tip

For more information on how to use unittest, visit: http://docs.python.org/2/library/unittest.html

Currently the best package that helps us write Python unit tests is called sublime-unittest written by Samuel Martin, which can be found at https://github.com/martinsam/sublime-unittest.

Using unittest for Sublime

Python's unittest for Sublime is a package that contains a number of useful snippets to ease our unittest writing. To install the package, we'll use Package Control. Let's open the command palette by pressing Ctrl + Shift + P in Windows or Linux and Command + Shift + P in OS X. Then choose Install Package and install the Unittest (python) package.

The installed package has two main snippets:

  • testclass: This will create a new test class for us to fill out

    class [Foo...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Mastering Sublime Text
Published in: Dec 2013Publisher: PacktISBN-13: 9781849698429

Author (1)

author image
Dan Peleg

Dan Peleg is an accomplished software engineer. As a former developer in the Israeli Intelligence Force, he holds extensive experience in both defense and robotic industries, and has previously lectured at DefCon conventions. Dan has developed unique algorithms for robotic platforms, specializes in a variety of software platforms, and currently works as the CTO for an American startup company.
Read more about Dan Peleg