This post explains how to use Python's unittest framework to write unit tests for your code. It covers topics such as writing tests with the TestCase class, exploring assert methods, running tests from the command line, and grouping tests with the TestSuite class.
Table of contents
Testing Your Python CodeGetting to Know Python’s unittestOrganizing Your Tests With the TestCase ClassExploring the Available Assert MethodsUsing unittest From the Command LineGrouping Your Tests With the TestSuite ClassCreating Test FixturesDebugging Failing TestsTesting With Fake Objects: unittest.mockConclusionSort: