Python for Testing Track

Python for Testing 102 (PT102)

Understand the fundamentals of software testing, learn how different testing techniques fit into the development process, and prepare for the PCAT™ – Certified Associate Tester with Python certification.

Course Details

Intermediate

4-5 Weeks

English

Free (Core)

500+ people already enrolled

Core

6 modules

40+ lessons

hands-on labs,

interactive exercises,

real-life data analysis scenarios, quizzes, and tests,

a Diploma of Course Completion,

a 20% discount code for the PCAT™ certification exam.

Free

Sign Up For Free




About the course

Python for Testing 102 (PT102) takes you beyond the fundamentals and into the practical world of building clean, maintainable, and scalable test suites using Python. You’ll learn how professional testers structure their code, manage resources, design robust assertions, apply mocking and fixtures, work with both unittest and pytest, and use TDD/BDD workflows to drive development with clarity and confidence.

By completing this course, you’ll build a strong foundation in software testing and be prepared for the PCAT™ – Certified Associate Tester with Python certification.

PT102 is organized into six learning modules. Each module explores a major area of Python-based software testing and includes step-by-step examples, hands-on tasks, and short assessments to help you put new skills into practice.

Target Audience


Python for Testing 102 (PT102) is ideal for:

  • Learners who completed PT101 and want to advance their testing skills.

  • Python developers looking to strengthen their professional testing practices.

  • Existing QA engineers and test engineers who want to expand their toolkit with Python-based testing.

  • Learners with foundational ISTQB knowledge who want to apply testing principles programmatically using Python.

  • QA beginners preparing for real-world testing workflows.

  • Anyone aiming to qualify for the PCAT™ – Certified Associate Tester with Python exam.

Prerequisites

To get the most out of PT102, you should have:

You should already be comfortable with basic Python programming. We recommend completing Python for Testing 101 (PT101), holding the PCEP™ – Certified Entry-Level Python Programmer certification, or having equivalent experience.


Associated Certification


Prior Experience Recommended:

PCEP Badge
PCET Badge

Entry

PCET Badge

PCET-30-0x

Certified Entry-Level Tester with Python

Associate

PCAT Badge

PCAT-31-0x

Certified Associate Tester with Python




What You Will Learn

By the end of this course, you will be able to:


Course Syllabus

  1. Context managers for safe setup and teardown,
  2. Decorators for logging, timing, and instrumentation,
  3. Instance, class, and static methods for flexible test utilities.
  1. Why unit testing matters
  2. Test structure and naming conventions
  3. The F.I.R.S.T. principles of effective tests
  4. Writing and running tests with unittest
  1. Common assertion patterns and best practices
  2. Error handling and exceptional cases
  3. Numeric comparisons and tolerance with floats
  4. Anagram and string-manipulation tests
  5. AAA pattern and clean test design
  1. Using setUp, tearDown, and class-level fixtures
  2. Parameterizing tests with subTest()
  3. Test filtering and markers
  4. Mocking external services with unittest.mock
  1. Introduction and project layout
  2. Pytest assertions and introspection
  3. Pytest fixtures and scopes
  4. Parameterization with @pytest.mark.parametrize
  5. Markers, configuration, and plugins (HTML reports, coverage)
  1. The TDD cycle and practical examples
  2. Refactoring safely with tests
  3. BDD basics and Gherkin
  4. Step definitions with behave


Python code example

Here’s a real snippet from the course so you can see how we learn in practice. One way to manage resources is by explicitly opening and closing them. Here’s an example of reading a file and making sure it gets closed:

Source Code:

   
main.py
file = open('the_file.txt')
try:
    for line in file:
        print(line, end='')
finally:
    file.close()


Let’s break this down:

  1. We open the file: file = open('the_file.txt')
  2. We process the file: read and print each line.
  3. We close the file: the finally block ensures that the file gets closed, even if an error happens while processing it.


Labs in the course

Learning to code happens by doing, not just reading. In the course, you’ll work through hands-on labs that turn concepts into real Python skills. Below are just a few examples of what you’ll build and solve.

Lab

Working with Context Managers

File handling becomes safer and cleaner with Python’s with statement. You’ll implement functions that rely on context managers to automatically manage opening and closing files.

Lab

Getting Started with Unit Testing

Instead of guessing whether code works, you’ll verify it with automated tests using Python’s unittest module. You’ll write structured test cases, run them, and debug failures when they appear.

Lab

pytest Fixtures: Setup and Teardown

Test setup gets cleaner as you replace repetitive code with reusable pytest fixtures. You’ll build setup/teardown logic, combine fixtures, and explore how scope affects isolation and performance.