Course Outline



  • Participants must have some background knowledge of Python programming language.


  • 2 - 3 days

Lab Setup

  • All participants must have a laptop with Internet connectivity
  • Make sure you have Python 2.6+/3.4+ or above installed.

Course Outline for Unit Testing with unittest and pytest in Python

Getting Started
  • Installation
  • What is Testing?
  • Need for Testing
  • Types of Testing
  • Writing Testcases
  • Testing Techniques
Introduction to Unit Test
  • Unit Testing in Python
  • Simple Unit test examples
  • Test discovery
  • Test Runner
  • Assert methods
Skipping tests and expected failures in unittest
  • Using the skip() decorator
  • Decorators to implement test skipping and expected failures
Fixtures in unittest
  • What are fixtures ?
  • setUpClass and tearDownClass
  • setUpModule and tearDownModule
  • Why pytest?
  • Assertion rewriting with pytest
  • Running unittests from pytest
Parameterizing and Fixtures in pytest
  • What is Parameterizing ?
  • Parameterizing in pytest
  • pytest Fixtures
  • Benefits of pytest fixtures
  • Built-in Fixtures
pytest Plugins
  • Installing and Using plugins
  • pytest-cov
  • pytest-xdist
  • pytest-catchlog
  • pytest-timeout
  • pytest-sugar

The classroom training will be provided in Bangalore (Bengaluru), Chennai, Hyderabad or Mumbai and will be conducted in the client's premises. All the necessary hardware/software infrastructure must be provided by the client.