Intermediate Python 3: Exceptions and Unit Testing
Handle errors deliberately and prove your code works: tracebacks, try and except in depth, raising, chaining and notes, custom exceptions, warnings and exception groups, then unittest from first assertion to fixtures, subtests and mocks.
- Intermediate level
- 3 modules
- 16 lessons
- 61 tasks and questions
Syllabus
01ExceptionsRead tracebacks, handle exceptions precisely, use else and finally for cleanup, raise, re-raise, chain and annotate errors, design custom exception hierarchies, and work with warnings and exception groups.7 lessons
02Unit testingAutomate your checks with unittest: assert, test cases and runners, the right assertion methods, fixtures and cleanups, subtests, skips and expected failures, and mocks for isolating dependencies.7 lessons
03ProjectPut exceptions and unit tests to work: pin down a buggy class's rules with tests, use them to find the bugs, and fix the code.2 lessons