testingdebuggingprofilingand tuning if you wanted to write unit tests for testing various aspects of the split(functionyou would create separate module testsplitter pylike thistestsplitter py import splitter import unittest unit tests class testsplitfunction(unittest testcase)def setup(self)perform set up actions (if anypass def teardown(self)perform clean-up actions (if anypass def testsimplestring(self) splitter split('goog 'self assertequal( ,['goog',' ',' ']def testtypeconvert(self) splitter split('goog ',[strintfloat]self assertequal( ,['goog' ]def testdelimiter(self) splitter split('goog, , ',delimiter=','self assertequal( ,['goog',' ',' ']run the unittests if _name_ =' _main_ 'unittest main(to run testssimply run python on the file testsplitter py here' an examplepython testsplitter py ran tests in ok basic use of unittest involves defining class that inherits from unittest testcase within this classindividual tests are defined by methods starting with the name 'test'--for example'testsimplestring''testtypeconvert'and so on (it is important to emphasize that the names are entirely up to you as long as they start with 'testwithin each testvarious assertions are used to check for different conditions an instancetof unittest testcase has the following methods that are used when writing tests and for controlling the testing processt setup(called to perform set-up steps prior to running any of the testing methods teardown(called to perform clean-up actions after running the tests lib fl ff