Do you want to learn how to automate tests in Python? Python is one of the best languages for test automation because it is easy to learn, concise to write, and powerful to scale. These days, there’s a wealth of great content on Python testing. Here’s a brief reference to help you get started.
If you are new to Python, read How Do I Start Learning Python? to find the best way to start learning the language.
If you want to roll up your sleeves, check out Test Automation University. I developed a “trifecta” of Python testing courses for TAU with videos, transcripts, quizzes, and example code. You can take them for FREE!
If you wants some brief articles for reference, check out my Python Testing 101 blog series:
- Python Testing 101: Introduction
- Python Testing 101: unittest
- Python Testing 101: doctest
- Python Testing 101: pytest
- Python Testing 101: behave
- Python Testing 101: pytest-bdd
- Python BDD Framework Comparison
RealPython also has excellent guides:
- Getting Started with Testing in Python by Anthony Shaw
- Effective Python Testing with Pytest by Dane Hillard
I’ve given several talks about Python testing:
- How to Write a Test Case at PyOhio 2020
- Hands-On Web App Test Automation (Tutorial) at PyCon 2020
- How to Start Testing with Python at Automation Guild 2020
- Beyond Unit Tests: End-to-End Web UI Testing at PyGotham 2019
- Hands-On Web UI Testing (Tutorial) at DjangoCon 2019
- Hands-On Web UI Testing (Tutorial) at PyOhio 2019
- Egad! How Do We Start Writing (Better) Tests? at PyTexas 2019
- Egad! How Do We Start Writing (Better) Tests? at PyGotham 2018
- Egad! How Do We Start Writing (Better) Tests? at PyOhio 2018
- Behavior-Driven Python at PyCon 2018
- Testing is Fun in Python! at PyData Carolinas 2016
If you prefer to read books, here are some great titles:
- Test-Driven Development with Python by Harry J.W. Percival
- Python Testing with pytest by Brian Okken
- pytest Quick Start Guide by Bruno Oliveira
Here are links to popular Python test tools and frameworks:
Do you have any other great resources? Drop them in the comments below! Happy testing!