Python: Introduction to Unittest

Lab Steps

lock
Web IDE Review
lock
Introduction to Unittest
lock
Test Runner: Main
lock
Test Runner: CLI
lock
Test Runner: Discovery
lock
Test Cases
lock
Test Cases: Assertions
lock
Test Cases: Setup/Teardown
lock
Test Cases: Skip Tests
lock
Test Failures
lock
Summary

The hands-on lab is part of this learning path

Ready for the real environment experience?

DifficultyIntermediate
Time Limit2h
Students38
Ratings
5/5
starstarstarstarstar

Description

Python's built-in unittest module is a testing framework for creating unit and integration tests.

The unittest module is worth learning because it's built into Python's standard library. Making it accessible without adding third-party dependencies.

This lab introduces the unittest module through hands-on learning.

Learning Objectives

Explore the fundamental building blocks of the unittest module.

At the end of this lab you'll be familiar with:

  • Test cases
  • Test methods
  • Assertion methods
  • Test runner

Intended Audience

  • Python Developers

Prerequisites

  • Familiarity with the Python runtime
  • Familiarity with the Python language syntax
  • Familiarity with callables
  • Familiarity with classes
About the Author
Students94776
Labs26
Courses44
Learning paths57

Ben Lambert is a software engineer and was previously the lead author for DevOps and Microsoft Azure training content at Cloud Academy. His courses and learning paths covered Cloud Ecosystem technologies such as DC/OS, configuration management tools, and containers. As a software engineer, Ben’s experience includes building highly available web and mobile apps. When he’s not building software, he’s hiking, camping, or creating video games.

Covered Topics