Course outline for Unit Testing with unittest and pytest
TechnologyUnit Testing with unittest and pytest in PythonDuration
* 2 - 3 days
LevelPrerequisites listed
About Unit Testing with unittest and pytest
Pre-requisites
- Participants must have some background knowledge of Python programming language.
Lab Setup
- All participants must have a laptop with Internet connectivity
- Make sure you have Python 2.6+/3.4+ or above installed.
How we train
Online training for Unit Testing with unittest and pytest
- Instructor-led live cohorts
- Self-paced learning with expert coaches
- 24x7 cloud labs with end-to-end examples
All sessions are 100% hands-on. Labs and activities are derived from real-world work our engineers deliver.
Classroom training
Available for corporate teams in:
- Bengaluru
- Chennai
- Hyderabad
- Mumbai
- Delhi/Gurgaon/NCR
- Pune
Note: Classroom training is for corporate clients only.
Self-paced hands-on sessions are delivered via VirtualCoach.
Detailed Course Outline
Hands-onGetting 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
pytest
- 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