Python offers unittest, an official unit testing framework for unit testing the scripts designed before deployment. It is also called as PyUnit. Python unit tests used in Sublime Text editor are called as sublime-unittests and they are available in the following link −
These unit tests contain a number of useful snippets to ease the writing of unit test cases.
The package control of Sublime manages the installation of unittests and the following steps describe it in detail −
Step 1 − Use the command palette of Sublime Editor Ctrl+Shift+P for installation of the package, as shown in the screenshots given below −
Step 2 − The installed packages use the following two main snippets −
testclass which is used to create a new test class
testfunc which is used to create a new test function for us to fill out
Step 3 − The console computes test results as shown in the screenshot below. Note that the result depends on the success or failure of the test.
Note − Unit test cases work as a compiler for computing scripts in python.