Testing is an integral part of the software development process. Unit
testing is a popular technique, and is used in test-driven development
(TDD). Python's unittest module in its standard library is quite
versatile, but more modern packages are available.
Unittest: illustration of using the unittest` framework in Python's standard library.PyTest:pytestis a more modern and convenient testing framework than that provided by Python's standard library.Asserts:assertis a Python statement, so it not part of unit testing per se. It is mainly intended for contract-based programming and one can prevent code to be emitted for asserts by using the-Ooptimizatino flag when running the code.DocTest: illustration of using doctest (part of the Python standard library.Hypothesis: illustration of using hypothesis for fuzz testing.