Third party cookies may be stored when visiting this site. Please see the cookie information.

PenguinTutor YouTube Channel

Python testing made fun - testing code using unittest

This video explains the benefits of using Python testing when programming. This is intended for makers who are coding software for physical computing, hobby software programmers and those looking to learn about software programming through school, college, university or adults looking to increase their skills.

Without any automated testing bugs can be harder to find and fix. Whilst I don't believe every piece of code should follow a formal structured testing schedule adding some tests to your code can be beneficial and can be enjoyable by allowing you to spend more time on the main programming and can in itself be fun.

The video covers some of the theory behind testing programming code, including test-driven development, code coverage, data coverage and generating tests using code. The practical example shows creating some simple code to perform testing of python code using unittest. It then shows how they can be stored in a separate directory and how they can be run very easily when updating software code.

Raspberry Pi matrix animation display project.

Python Unittest library documentation.