Python for Testing

Programmers and quality (QA) professionals who want to automate software testing.
During the course, students will learn to:
- Write, read and debug basic Python programmes.
- Understand the purpose and value of software testing.
- Differentiate between errors, defects and failures.
- Correctly apply manual and automated testing approaches.
- Work with different levels of testing: unit, integration, system and acceptance.
- Use assertions, logging and debugging techniques in Python.
- Understand static and dynamic testing methods.
- Apply black-box, white-box and experience-based testing techniques.
- Improve code quality using refactoring principles such as DRY and KISS.
- Develop a solid foundation to continue training in QA, automated testing, and software engineering.
- Develop a complete project from start to finish: continue the Crossword Helper app and expand it (palindromes → ROT shifts → anagrams → pattern matching) through tests that guide design.
- Strengthen your toolkit with unittest: apply the F.I.R.S.T. structure for tests, write precise assertions (assertEqual, assertAlmostEqual, assertRaises, assertCountEqual), eliminate duplication using setUp/tearDown and class/module hooks, use subTest() and control executions with @skip/@expectedFailure.
- Adopt pytest for speed and clarity: use native assert with advanced inspection, reusable fixtures (including clean-up with yield) and various scopes (from function to session), parametrisation with @pytest.mark.parametrize, markers (skip/xfail/importorskip), targeted selection (-k/-m), verboseness and reporting options (-v, -r), and also centralised configuration in pytest.ini.
- Confidently perform mocks: replace slow or fragile input/output operations using unittest.mock (stubs, fakes and spies), work with Mock/MagicMock, apply patch with spec/create_autospec and use the mocker fixture from pytest-mock.
- Measure and report results: generate code coverage with pytest-cov and share outcomes with pytest-html, including self-contained reports.
- Apply TDD and BDD: practise the Red → Green → Refactor cycle in small increments, safely refactor with “Pythonic” enhancements such as zip(), and describe behaviours with Gherkin (Feature/Scenario, Given/When/Then) linked to step definitions in Python (e.g. with behave).
PYTHON FOR TESTING 101
Module 1: Introduction to Software Testing
- Understanding software testing.
- Errors, defects and failures.
- Testing in the software development lifecycle.
- Balancing risk and release: when to stop testing.
- The role of testers: challenges and collaboration.
- Principles of testing: debunking common misconceptions.
Module 2: The Testing Pyramid and Test Process
- Types of software testing.
- Testing levels.
- The testing pyramid.
- Unit testing.
- Integration testing.
- End-to-end testing (E2E).
- Test doubles.
- The testing process.
- Test documentation.
Module 3: Static Analysis and Code Refactoring
- Static vs. dynamic testing.
- Code quality: PEP 8 and linters.
- Static analysis and improving code quality.
- Test coverage and metrics.
- Code refactoring.
- Identifying legacy code.
- Arrange, Act, Assert pattern.
- Refactoring legacy code.
- DRY principle.
- KISS principle.
Module 4: Debugging, Assertions and Testing Techniques
- Debugging.
- Introduction to assertions.
- Working with multiple assertions in Python.
- Recording test results.
- Testing techniques.
- Types of white-box testing techniques.
- Types of black-box testing techniques.
- Types of experience-based testing techniques.
PYTHON FOR TESTING 102
Module 1: Clean Testing Infrastructure: Context Managers, Decorators and Method Patterns
- Resource management in Python.
- Context Managers.
- Introduction to decorators.
- Function decorators.
- Creating decorators with *args and **kwargs.
- Composing and stacking decorators.
- Introduction to class decorators.
- Advanced class decorators.
- Understanding methods in Python.
Module 2: Unit Testing Fundamentals with unittest
- Testing frameworks.
- Introduction to unit testing.
- Running unit tests and passing arguments.
- Using the -m flag and verbosity levels.
- Practical unit testing.
Module 3: Project-Driven Testing: Assertions, Errors, Tolerance and Anagrams
- Main assertions in unittest.
- Crossword Project – Part 1: from idea to tests.
- Crossword Project – Part 2: assertions, errors and fixes.
- Crossword Project – Part 3: fundamentals of test design.
- Crossword Project – Part 4: exception testing.
- Crossword Project – Part 5: tests for anagrams and collections.
Module 4: Project-Driven Testing: Fixtures, Parametrisation and Mocks
- Crossword Project – Part 6: test fixtures.
- Crossword Project – Part 7: parametrisation.
- Crossword Project – Part 8: managing test states.
- Crossword Project – Part 9: simulating external services and HTTP responses.
- Crossword Project – Part 10: mocks and dependencies (stubs, fakes and spies).
- Crossword Project – Part 11: safe interface mocks (spec, autospec, MagicMock).
- From monkey patching to maintainable patchers.
- Review of unit tests for the Crossword Helper project.
Module 5: Testing with pytest
- Introduction, installation and first test with pytest.
- Assertions and introspection in pytest.
- Fixtures: setup and teardown.
- Parametrisation in pytest.
- Markers and skipping tests in pytest.
- Plugins and extensions in pytest.
- Working with test doubles.
- Customising test discovery and execution in pytest.
Module 6: Test-Driven and Behaviour-Driven Development
- Introduction to Test-Driven Development (TDD).
- Getting started with TDD.
- Iteration and continuous improvement with TDD.
- Fundamentals of Behaviour-Driven Development (BDD).
- Practical BDD scenarios.
Basic knowledge of Python.
Prepare for an official certification
Prepare for the official PCAT™ – Certified Associate Tester with Python certification.
100% online training with tutorial support: progress at your own pace with the support of a tutor throughout the course, compatible with work or studies.
Course content in English.
Price for the private mode (individual payment).
What people say about us on Google
4.9 282 Google reviews3 years ago
It is a very nice place. Very professional staff.
9 years ago
Very english many fun
a month ago
This center has been a fantastic discovery for me. My reception staff, Núria and Susana, were incredibly helpful and friendly. Walter, the advisor, is a very kind and dedicated person, and a great help with any questions that came up. My teacher for the telecare course was Jonatan, a highly professional, empathetic, and patient individual. He makes you feel very comfortable in class and encourages you to improve. I wholeheartedly recommend the center and its teachers, especially Jonatan, who helped me tremendously in acquiring new knowledge. Don't hesitate to go and find out about all the courses they offer. All I can say is thank you to everyone.
2 months ago
I completed the Accounting and Administrative Management for Auditing course, and my experience was very positive. I especially want to highlight Marivel, an excellent teacher who explained the material clearly and simply, making potentially complex topics much easier to understand. She was also always very willing to help and answer all the students' questions, with great patience and a friendly approach. I also want to mention Xavi, with whom I had the opportunity to take another course previously. Although he wasn't my teacher this year, I can say that he is also an excellent professional, very patient, kind, and always willing to help. Overall, I am very satisfied with the training and, above all, with the teachers' approach and dedication.
a month ago
I'm very happy to have taken the telecare course at this center. The experience has been very positive, both in terms of the learning and the treatment I received from all the staff at Tau Formar. Our teacher, Jonatan, stands out for his dedication, patience, and the way he explains things. He makes the classes interesting and easy to learn, and he really motivates us. He's an excellent teacher. Susana, Walter, and Plácido are also very kind and highly professional. I 100% recommend this center.
Interested in this course?
Request information and we will call you as soon as possible.
