Automated Testing in Python with pytest, tox, and GitHub Actions

preview_player
Показать описание
Take your Python project to the next level of professionalism.

Automated testing in Python is an important way to take your Python project to the next level of dependability and professionalism. There are a lot of steps, but it's not too difficult to setup your tests to run automatically across multiple different operating systems and versions of Python whenever you push a commit or receive a pull request on your repository. We show you the entire process, step by step, to take a plain old project and turn it into an installable package with automated tests that run when you push to GitHub. We use pytest, mypy, and flake8 for testing, type checking, and code linting. Then we use tox to run all of these commands in isolated virtual environments. Finally, we use GitHub actions to run tox on a push or a pull request. Automated testing is the first and most important step in the more general world of continuous integration (CI), and continuous delivery or continuous deployment (CD). In this video we focus on automated testing, not on general CI/CD, as there is already PLENTY of material to cover.

SUPPORT ME ⭐
---------------------------------------------------

Top patrons and donors: Laura M, Jameson, John Martin, Dragos C, Vahnekie, Pieter G, Sigmanificient, Casey G

BE ACTIVE IN MY COMMUNITY 😄
---------------------------------------------------

CHAPTERS
---------------------------------------------------
0:00 Intro
1:21 Overview of the video
2:56 Structuring your project
8:35 Pytest, mypy, flake8
10:58 Pytest features
18:34 Test multiple envs with tox
21:18 Test on commit with GH Actions
25:22 Readme badge
26:34 Thanks
Рекомендации по теме
Комментарии
Автор

Finally someone discussing project setup, directory structure, git workflows etc. There needs to be more videos like this.

Jacob
Автор

I've been blindly pattern matching for spinning up repos for awhile now and it's nice to see explanations for a lot of those choices. I also didn't realize all the pytest functionality I was missing. I like this longer/more detailed style too - it's necessary for training strong engineers. (Though, not sure if it's the best choice for YouTube growth). Thanks for making this. I'll be recommending it to coworkers.

Mutual_Information
Автор

Utterly brilliant walkthrough!
Our company is currently implementing automated testing for a new project and all config requirements have worried me that I have no clue what's going on and would have no clue if stuff went wrong!
This is so clearly explained and motivated, I feel perfectly equipped to ensure we can implement it all and know all our tests are run!

nathanbrown
Автор

YouTube is my Netflix when it comes to content related to programming, databases and DevOps, so I go through a ton of content regularly. but this video was one of THE most informative pieces of content I've ever watched. As a lower-intermediate Python programmer, making python apps installable has always been a head-scratcher for me and it hasn't been easy to find content which address almost all aspects of the process with clear guidelines. You just made my life MUCH easier and I thank you for that.

shibak
Автор

This is great, I agree, finally someone talking about how to package a python project

enctqlg
Автор

The perfect amount of info to get started with automated testing. Thank you!

JBRD
Автор

The quality of this content *Chef's kiss*

pwned
Автор

Thank you for this great resource into the current mess of python packaging. It's something I've spent many hours trying to figure out, and now I know I missed a bunch. And with you handing a test setup on a silver platter, I now have no excuse to bring with formal testing.

Once again, thank you. I really liked the longer format (when required) and am happy you didn't chop it up into parts.

I would be really interested in similar in-depth videos on the things you mention in the video overview for example. If you could make a video on how to create a Python wrapper for a C library, I would be ecstatic.

tim-timman
Автор

This will be a great reference video, somewhat like a good stack overflow answer you keep referring :)

tushargupta
Автор

Was literally trying to figure out testing for the past week, its like you know exactly what I'm struggling on!
Great video as always

therealplnts
Автор

This essentially was my experience doing this for work, except I didn't have this video explaining everything and had to rely on the python documentation. Thanks a bunch!

grelyelo
Автор

This is by far your most advanced tutorial. Too much info in a single video but still super helpful. Thanks !

shreydixit
Автор

one of the most important python tutorials I have ever seen. It covers a wide range of daily problems as python programmer.

PhilippGrafendorfer
Автор

Please make more videos like this. I've been having a lot of trouble when it comes to creating a github project. It's hard to find resources on project structure, git workflow, package structure, versioning, etc. If possible, it would be nice if you could create a series showing how to create and maintain a github repo. I want to understand how to increase versions, how to review pull requests and issues, how to write a good commit message, how to create tags/releases, how to create a documentation, and much more.

LucasSilva-jdbf
Автор

This is pretty incredibly actually. I've done some very basic tests in the past, but never as complete or solid as this, not even close, thanks for this!

oxey_
Автор

The discussion on the project structure was fantastic, really insightful. It such an important aspect of a Python project, yet you don't see much information on it.

dylanalexander
Автор

I was originally only looking for YouTube videos on pytest. With this video I found much more and it answered many questions that I have had regarding tox and GitHub integrations.

Great video ... 👍👍👍

marksawyer
Автор

best video on distilling all the different configuration files and why they are all needed - thanks for this!

mbkhan
Автор

This is what I was looking for. Many thanks for covering these topics. I was specifically looking for how to install local package in current env, finally someone explained.

OnceARider
Автор

I love this subject and I love this video.

I'm glad this guy happened to make it a week ago, because it happens to be just what I need, when I need it. I'm stubbornly committing to TDD best-practices in my projects as I currently polish a template for my pytests.

joem