Course Name
Course Code : PRR35
Venue Details
Postal Code : 2
Session Dates
Duration: 2 days (14 hours)
Unit testing with Python training focuses on teaching participants how to write effective and maintainable unit tests for Python applications. The course covers the fundamentals of Python's unittest framework, including test case creation, test discovery, and running tests. Participants also learn to use popular libraries like pytest for advanced testing capabilities, such as fixtures, parameterized tests, and mocking. Hands-on exercises include writing test cases, organizing test suites, and integrating testing with CI/CD pipelines for continuous quality assurance. By the end of the training, attendees are equipped to implement robust unit testing strategies to ensure code reliability and quality.
Introduction to Unit Testing and Writing Basic Tests Introduction to Unit Testing What is unit testing and why is it important in software development? Overview of testing principles: small, isolated, repeatable tests. The role of unit testing in Continuous Integration and Continuous Delivery (CI/CD). Tools for unit testing in Python: unittest, pytest, nose. Hands-On Exercise Getting Started with Python’s unit test Framework Introduction to the unittest module in Python. Writing the first test case using unittest.TestCase. Understanding the structure of test cases: test methods, setup, and teardown. Running tests with unittest and understanding test results. Hands-On Exercise Assertions and Test Results The importance of assertions in unit testing. Using built-in assertions: assertEqual(), assertTrue(), assertFalse(), assertRaises(). Understanding test outcomes: passing, failing, and skipping tests. Hands-On Exercise Test Suites and Organizing Tests Grouping related test cases using unittest.TestSuite. Running multiple test cases together. Organizing tests in separate modules for better maintainability. Hands-On Exercise Summary and Q&A Recap of key concepts learned on Day 1. Open Q&A session to address any doubts or questions. Advanced Testing Techniques and Mocking Test-Driven Development (TDD) with Python Introduction to Test-Driven Development (TDD) and its benefits. The red-green-refactor cycle: writing tests before implementation. Writing test cases to define functionality and guide code design. Hands-On Exercise Mocking and Isolation in Unit Tests Why mocking is necessary: isolating code dependencies for unit tests. Introduction to Python’s unittest.mock module. Mocking objects, functions, and classes for isolated testing. Using patch() to mock external resources like databases and APIs. Hands-On Exercise Advanced Assertions and Edge Case Testing Writing assertions for edge cases and exception handling. Testing for boundary conditions and input validation. Validating error handling and exceptions in unit tests. Hands-On Exercise Running and Debugging Unit Tests Running tests using the command line and integrating with CI tools. Debugging failing tests and identifying the root causes. Generating test reports and logs for better visibility. Hands-On Exercise Final Project: Implementing Unit Testing Applying learned concepts in a final hands-on project. Writing unit tests for a real-world Python application or module. Reviewing and improving test coverage, code quality, and TDD practices. Hands-On Exercise Course Summary and Q&A Recap of key concepts learned throughout the course. Final Q&A session to address any remaining questions or challenges.
Mode of Delivery : The event can be attended both online and at nearby ProgNXT classroom by Individual Professionals and Corporate Employees as per the seat availability. Please Contact Us at [email protected] for checking the seat availability
Audience : We have a global audience that logs in to using their own computers to work hand in hand with our world-class instructors.
Assessment : Each training course will have ProgNXT Assessment at the end.
Certification : After successful passing of ProgNXT Assessment, ProgNXT Certification will be provided, which has got acceptance in 55+ Countries.
| Global Region | Location | Start Date | End Date | Action |
|---|---|---|---|---|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |