Unit Testing
Unit testing is essential to creating effective and bug-free programs. In Python, unit testing has its own class. This video explains the process of Python by creating a class that uses arithmetic functions:
The assert functions used in this video can be seen here:

Examples of Unit Testing in Python
This is the unit testing code done for a binary search program. It tests to make sure that the list sorted has the correct amount of values for the iterative function as well as the recursive function. Negative value lengths are used to make sure the exception is called. The function genlist generates a random list, so the unit testing function asserts that the length of the list remains the same, and that the "negative length value" exception is raised. Function insertionSort asserts that the list is properly sorted.