The pytest framework is simple to use but powerful enough to cover complex testing integration scenarios. PyTest is considered by many to be the true Pythonic approach to testing in Python.
Geared for QA, Test team members and others who want to use the Python testing framework PyTest to implement code testing strategies, Test Automation with Python is a hands-on, two day Python testing course that provides students with the skills required to get started with PyTest right away. Participnats will learn how to get the most out of it in their daily workflow, exploring powerful mechanisms and plugins to facilitate many common testing tasks. Students will also learn how to use pytest in existing unittest-based test suites and will learn some tricks to make the jump to a pytest-style test suite quickly and easily.
This skills-focused course is approximately 50% hands-on, combining expert lecture, real-world demonstrations and group discussions with machine-based practical labs and exercises. Working within in a hands-on learning environment students will learn to:
- Become proficient with pytest from day one by solving real-world testing problems
- Use pytest to write tests more efficiently
- Scale from simple to complex and functional testing
- Write and run simple and complex tests
- Organize tests in fles and directories
- Find out how to be more productive on the command line
- Markers and how to skip, xfail and parametrize tests
- Explore fxtures and techniques to use them effectively, such as tmpdir, pytestconfg, and monkeypatch
- Convert unittest suites to pytest using little-known techniques
This in an introductory-level course geared for QA, Test team members and others who want to use the Python testing framework PyTest to implement code testing strategies. Attendees should have prior basic Python scripting experience. Students should have some familiarity with tools to be used in this course: PyCharm, Jupyter Notebook and basic GIT.
Our Python tracks include a wide variety of follow-on courses and learning paths for leveraging Python for next-level web development, data science / machine learning, networking, task automation, security and other topics. Please see the Related Courses tab for specific Pre-Requisite courses, Related Courses or Follow On training options. Our team will be happy to help you with recommendations for next steps in your Learning Journey.
Please note that this list of topics is based on our standard course offering, evolved from typical industry uses and trends. We’ll work with you to tune this course and level of coverage to target the skills you need most.
- Python Quick Refresh
- Python Overview
- Python Basics
- Python Lab
- Introducing PyTest
- Why Spend time writing test
- UnitTest Module
- Why PyTest?
- Introductory Lab
- Writing and Running Test
- Installing PyTest
- Writing and Running Tests
- Organizing files and packages
- Command Line options
- Configure pytest.ini
- Install and Config Lab
- Markers and Parameters
- Mark Basics
- Built-in marks
- Markers and Parameters Lab
- Introduction to Fixtures
- Sharing fixtures with conftest.py files
- Parameterizing fixtures
- Using marks from fixtures
- Built-in fixtures
- Best Practices
- Fixtures Lab
- Fixtures Lab 2
- Finding and installing plugins
- Overview of plugins
- Plugin Lab
- From UnitTest to PyTest
- Use PyTest as a Test Runner
- Convert asserts with unitest2pytest
- Handling setup/teardown
- Managing test hierarchies
- Refactoring test utilities
- Migration strategies
Course Materials: Each participant will receive a Student Guide with course notes, code samples, software tutorials, step-by-step written lab instructions, diagrams and related reference materials and resource links. Students will also receive the project files (or code, if applicable) and solutions required for the hands-on work.
Hands-On Setup Made Simple! Our dedicated tech team will work with you to ensure our ‘easy-access’ cloud-based course environment is accessible, fully-tested and verified as ready to go well in advance of the course start date, ensuring a smooth start to class and effective learning experience for all participants. Please inquire for details and options.