Book Image

Mastering Sublime Text

By : Dan Peleg
Book Image

Mastering Sublime Text

By: Dan Peleg

Overview of this book

Sublime is the leading platform for developing websites, applications, and software. Sublime Text is a sophisticated, cross-platform text and source code editor. It supports a number of different programming languages and is extremely efficient and feature rich. With Sublime Text, programmers can develop their web applications faster and with more efficiency. This book will put you at the frontier of modern software development. It will teach you how to leverage Sublime for anything from mobile games to missile protection. Above all, this book will help you harness the power of other Sublime users and always stay on top. This book will show you how to get started, from basic installation through lightning fast code navigation and up to the development of your own plugins. It takes you from the early stages of navigating through the platform and moves on by teaching you how to fully customize your platform, test, debug, and eventually create and share your own plugins to help and lead this community forward. The book will then teach you how to efficiently edit text, primarily by using the keyboard. You will learn how to interact with the Sublime Text community using the mailing lists and IRC.
Table of Contents (15 chapters)
Mastering Sublime Text
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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...