Here’s the brief about the Python Debugging and testing.
• IDLE supports debugging
• A simple text mode interactive debugger is also available
• ‘assert’ statement is used to introduce debugging code into a program
• ‘__debug__’ -> built in variable
- the functions surrounded by ‘if __debug__’ will be executed only when ‘__debug__’ is true
Testing of Python
• Python has modules that help a tester in unit testing the code
- docTest – Embedded in the source code
- unittest – separate module
- example