Test-Driven Development In Python
Published by O'Reilly Media, Inc.
Optimizing Code with Unittest and Pytest
Course Outcomes:
- Use automated tests to write richer, more complex software in Python than ever before
- Spend LESS time debugging than you ever dreamed possible
- Build a personal, automated "QA Army" that lets you fearlessly refactor large Python apps
- Focused first on Python's built-in unittest library, then learning how to do the same in Pytest
The ability to write tests is a superpower... separating average developers from the best Pythonistas on earth.
Master this transformative skill, and you suddenly find yourself writing more complex, powerful software than you ever could before. Do not underestimate how much this can change your career.
In this hands-on, intermediate Python class, you quickly learn the key concepts of automated testing, and how to harness them today in your Python code.
Starting with Python's built-in "unittest" library, before showing you how they work in the popular Pytest framework as well, you learn the universal patterns and time-tested techniques of testing... letting you transfer what you learn to any testing library, in any language.
With ongoing live Q&A, and repeated in-class code exercises, this course is the fastest way to add test-driven development to your skill set. Come ready to write code, and quickly learn a lot.
What you’ll learn and how you can apply it
By the end of this live, online course, you’ll understand:
- The value and benefit of writing tests brings to your code… and your career
- The key tools and types of automated tests, and where to use them
- The common code organization and concepts for xUnit Libraries. Not just in Python, but in many other languages
And you’ll be able to:
- Leverage the most powerful and time-tested patterns for unit tests
- Write code using a test-driven style of development
- Effectively organize their test code for even the most complex applications
This live event is for you because...
- You're a software engineer who cares about robust, reliable, and maintainable code... or you're just sick and tired of wasting your life hunting down stupid bugs
- You’re a tech lead or engineering manager who wants to improve robustness, code quality, and agility across your entire team
- You're a data scientist who wants to fearlessly modify numerical code, without worrying about introducing crippling and subtle bugs
- You're a web developer ready to take on more complex and extensive web applications
- You're a QA engineer who wants to lead by example, and build more robust tooling
- You want to improve your Python knowledge to ace an interview or land that dream job
Prerequisites
- Able to run Python programs from the command prompt (necessary for this class)
- Familiar with writing Python functions, simple classes, and methods
- Fully able to work with the common Python types and data structures, like lists and dictionaries
Students will be given a link to download materials at the beginning of class.
REQUIRED SETUP:
- Have Python 3.8+ installed on your machine. Earlier versions are NOT acceptable for this class
Schedule
The time frames are only estimates and may vary according to how the class is progressing.
- Intro & logistics
- Why Writing Tests Is A Superpower
- The Different Kinds Of Automated Tests
- Testing Frameworks: The unittest module
- Unit Tests And Simple Assertions
- Lab: The Text Body
- Test Organization
- Fixtures And Common Test Setup
- Asserting Exceptions
- Subtests For Comprehensive Parameterized Tests
- Lab: More Advanced Testing
- Mocks For Rapid Indirect Testing
- Tooling For Test Automation
- The Popular Pytest Framework
THROUGHOUT: Live Q&A and in-class coding exercises.
Your Instructor
Aaron Maxwell
Aaron Maxwell is author of the book "Powerful Python: The Most Impactful Patterns, Features, and Development Strategies Modern Python Provides." As a software engineer, he has worked in devops, test automation, and machine learning, and now divides his time between coding, writing, and teaching