Testing in Python
Testing in Python
- 820
Readers
- 170
Pages
- 35,010
Words
- 60 days
guarantee
English
PDF
EPUB
-
WEB
About the Book
Getting started with testing can be hard, and this book aims make it all very easy by using examples and explaining the process in a straightforward way. Testing is a core principle of robust software implementations and should be a prime skill to master that can be applied to any project.
Share this book
Categories
- Python
- Automated Software Testing
- Software Engineering
Installments completed
10 / 10
Feedback
Email the Author(s)
About the Authors
Noah Gift lectures at MSDS, at Northwestern, Duke MIDS Graduate Data Science Program, and the Graduate Data Science program at UC Berkeley and the UC Davis Graduate School of Management MSBA program, and UNC Charlotte Data Science Initiative. He is teaching and designing graduate machine learning, A.I., Data Science courses, and consulting on Machine Learning and Cloud Architecture for students and faculty. These responsibilities include leading a multi-cloud certification initiative for students.
Noah is a Python Software Foundation Fellow. He currently holds the following industry certifications for AWS: AWS Subject Matter Expert (SME) on Machine Learning, AWS Certified Solutions Architect, and AWS Certified Machine Learning Specialist, AWS Certified Big Data Specialist, AWS Academy Accredited Instructor, AWS Faculty Ambassador. He also is certified on both the Google and Azure platform: Google Certified Professional Cloud Architect, Certified Microsoft MTA on Python. He has published over 100 technical publications including multiple books on subjects ranging from Cloud Machine Learning to DevOps. Publications appear in F orbes, IBM, Red Hat, Microsoft, O'Reilly, Pearson, Udacity, Coursera, datascience.com, and DataCamp. Workshops and Talks around the world for organizations including NASA, PayPal, PyCon, Strata, O'Reilly Software Architecture Conference, and FooCamp. As an SME on Machine Learning for AWS, he helped created the AWS Machine Learning certification.
He has worked in roles ranging from CTO, General Manager, Consulting CTO, Consulting Chief Data Scientist, and Cloud Architect. This experience has been with a wide variety of companies: ABC, Caltech, Sony Imageworks, Disney Feature Animation, Weta Digital, AT&T, Turner Studios, and Linden Lab, and industries: Television, Film, Games, SaaS, Sports, Telecommunications. He has film credits in many major motion pictures for technical work, including Avatar, Spider-Man 3, and Superman Returns.
He has been responsible for shipping many new products at multiple companies that generated millions of dollars of revenue and had a global scale. Currently, he is consulting startups and other companies, on Machine Learning, Cloud Architecture, and CTO level consulting as the founder of Pragmatic A.I. Labs.
His most recent books are:
- Pragmatic A.I.: An introduction to Cloud-Based Machine Learning (Pearson, 2018)
- Python for DevOps (O'Reilly, 2020).
His most recent video courses are:
- Essential Machine Learning and A.I. with Python and Jupyter Notebook LiveLessons (Pearson, 2018)
- AWS Certified Machine Learning-Specialty (ML-S) (Pearson, 2019)
- Python for Data Science Complete Video Course Video Training (Pearson, 2019)
- AWS Certified Big Data - Specialty Complete Video Course and Practice Test Video Training (Pearson, 2019)
- Building A.I. Applications on Google Cloud Platform (Pearson, 2019)
- Pragmatic AI and Machine Learning Core Principles (Pearson, 2019)
- Data Engineering with Python and AWS Lambda (Pearson, 2019)
His most recent online courses are:
- Microservices with this Udacity DevOps Nanodegree (Udacity, 2019)
- Command Line Automation in Python (DataCamp, 2019)
- AWS Certified Cloud Practitioner 2020-Real World & Pragmatic
You can follow Noah Gift on social media and on the web at:
Alfredo Deza is a passionate software engineer, avid open source developer, Vim plugin author, photographer, and former Olympic athlete. He has given several lectures around the world about Open Source Software, personal development, and professional sports. He has rebuilt company infrastructure, designed shared storage, and replaced complex build systems, always in search of efficient and resilient environments. With a strong belief in testing and documentation, he continues to drive robust development practices wherever he is.
As a spirited knowledge-craving developer Alfredo can be found giving presentations in local groups about Python, file systems and storage, system administration, and professional sports.
His most recent publication is Python For DevOps (O'reilly), and you can follow him on LinkedIn.
Bundles that include this book
About the Contributors
Alfredo Deza is a passionate software engineer, avid open source developer, Vim plugin author, photographer, and former Olympic athlete. He has given several lectures around the world about Open Source Software, personal development, and professional sports. He has rebuilt company infrastructure, designed shared storage, and replaced complex build systems, always in search of efficient and resilient environments. With a strong belief in testing and documentation, he continues to drive robust development practices wherever he is.
As a spirited knowledge-craving developer Alfredo can be found giving presentations in local groups about Python, file systems and storage, system administration, and professional sports.
His most recent publication is Python For DevOps (O'reilly), and you can follow him on LinkedIn.
Table of Contents
-
Introduction
- Why test at all?
- Leveling up from simple scripts to robust implementations
- Python, Pytest, Tox supported versions in this book
- About the cover
-
Chapter 1: Configuring the environment
- Setting up and using Git
- Setting up and using Virtualenv
- Installing packages and dependencies
- Setup Visual Code code
- Setup and use Vim
- Setup Makefile
- Setup and Use ZSH/Bash
- Using Cloud-based development environments
-
Chapter 2: Testing Conventions
- Directories
- Files
- Functions, Classes, and test methods
- Special test class methods
- Good naming patterns
-
Chapter 3: Introduction to Pytest
- The most simple test possible
- Why is Pytest important?
-
The power of
assert
- Pytest vs. Unittest
-
Chapter 4: Test Classes
- Setting up and teardown of xunit-style tests
-
Chapter 5: Reporting
- PyTest Reporting
- Code Quality
- Linting
- Code Formatting with Python Black
-
Chapter 6: Debugging with Pytest
- How to debug code
- Using a debugger
- Python Debugger (PDB) integration
-
Chapter 7: Pytest fixtures and plugins
- What are fixtures?
- Creating new fixtures
- Built-in Fixtures
- Advanced Fixture usage
- Parametrizing
-
Chapter 8: Monkeypatching
- Why and when to monkeypatch?
- monkeypatching is hard
- The simplest monkeypatching
- Automatic and global monkeypatching
- Other patching
- When not to monkeypatch
-
Chapter 9: Testing matrix with Tox
- Testing different Python versions
- Expanding the testing matrix
- Linting and other validations
-
Chapter 10: Continuous Integration and Continuous Delivery
- What is Continuous Integration and Continuous Delivery and Why Do They Matter?
- Jenkins
- CircleCI
- GCP Cloud Build
- Continuous Delivery for Hugo Static Site from Zero using AWS Code Pipeline
- Github Actions
-
Chapter 11: Case Studies and War Stories
- Testing Click Commandline Tools
- War Story: The Health Check that wasn’t wrong
- War Story: The Nine Circles of Hell While Parsing XML
- War Story: The Mysterious Vanishing Servers
-
Chapter 12: Essays
- Writing clean, testable, high quality code in Python
- Increase reliability in data science and machine learning projects with CircleCI
- Data science project quality
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn 8ドル on a 10ドル Purchase, and 16ドル on a 20ドル Purchase
We pay 80% royalties on purchases of 7ドル.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between 0ドル.99 and 7ドル.98. You earn 8ドル on a 10ドル sale, and 16ドル on a 20ドル sale. So, if we sell 5000 non-refunded copies of your book for 20ドル, you'll earn 80,000ドル.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover 14ドル million writing, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them
Write and Publish on Leanpub
You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!
Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.
Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.