Visão Geral
O curso Automated Testing with Python and Pytest tem como objetivo capacitar os participantes a desenvolver, estruturar e executar testes automatizados utilizando o framework Pytest, uma das ferramentas mais populares e poderosas do ecossistema Python. O curso aborda desde os fundamentos de testes automatizados até a criação de suítes de testes avançadas, com foco em produtividade, boas práticas e integração contínua.
Conteúdo Programatico
Introduction to Automated Testing
- Benefits and principles of automated testing
- Types of tests: unit, integration, functional, and regression
Getting Started with Pytest
- Installing and configuring Pytest
- Writing and running simple tests
- Understanding test discovery and naming conventions
Test Organization and Structure
- Creating test suites and modules
- Using
conftest.py for shared configuration
- Organizing large test projects
Fixtures and Test Data Management
- Creating and reusing fixtures
- Fixture scopes and teardown processes
- Managing temporary files and resources
Assertions and Parametrization
- Using built-in and custom assertions
- Parametrizing tests for multiple inputs
- Handling expected exceptions
Mocking and Monkeypatching
- Mocking external dependencies
- Using
unittest.mock and Pytest monkeypatch
- Testing APIs and external integrations
Advanced Pytest Features
- Using markers and command-line options
- Skipping and xfail tests
- Custom plugins and configuration
Reporting and Test Results
- Generating HTML and JUnit reports
- Integrating with Allure and CI tools
- Tracking test metrics and failures
Continuous Integration with Pytest
- Integrating Pytest with GitHub Actions, Jenkins, or GitLab CI
- Running automated test pipelines
- Code coverage with
pytest-cov
Best Practices and Troubleshooting
- Writing maintainable and scalable tests
- Debugging failed tests
- Common pitfalls and how to avoid them