

Test & Code
Brian Okken
The Python Test Podcast hosted by Brian Okken
Episodes
Mentioned books

Jun 11, 2021 • 40min
157: pre-commit - Anthony Sottile
pre-commit started as a framework for running linters and code formatters during git actions via git hooks. It's grown and expanded and now supports an extensive list of languages and actions and manual running of actions. But even at it's core, it's great for letting computers nitpick about whitespace and formatting, so that code reviews can focus on architecture and design.Anthony Sottile discusses pre-commit, for using locally by developers, and pre-commit.ci, which can run actions during merge requests."Git hook scripts are useful for identifying simple issues before submission to code review. We run our hooks on every commit to automatically point out issues in code such as missing semicolons, trailing whitespace, and debug statements. By pointing these issues out before code review, this allows a code reviewer to focus on the architecture of a change while not wasting time with trivial style nitpicks." - pre-commit.com"Developers spend a fair chunk of time during their development flow fixing relatively trivial problems in their code. pre-commit.ci both enforces that these issues are discovered, which is opt in for each developer workflow via pre-commit, but also fixes the issues automatically, letting developers focus their time on more valuable problems." - A user of pre-commit.ciLinks:pre-commitpre-commit supported hookspre-commit.ci

Jun 3, 2021 • 21min
156: Flake8: Python linting framework with Pyflakes, pycodestyle, McCabe, and more - Anthony Sottile
Flake8 is a command-line tool for linting Python projects. By default, it includes lint checks provided Pyflakes, pycodestyle, and McCabe It's also a platform, and allows plugins to extend the checks. Flake8 will run third-party extensions if they are found and installed.But what does all of that mean?Anthony Sottile is a maintainer of flake8 and has kindly offered to explain it to us.Links:Flake8: Your Tool For Style Guide Enforcementpyflakespycodestylemccabepyflakes/messages.pyflake8 Error / Violation Codeswemake-python-styleguideflake8-typing-importstox automation projectNoxpre-commit

May 28, 2021 • 21min
155: Four Questions to Ask Frequently During Software Projects - Tim Ottinger
Tim Ottinger has four questions that work great in many situations, from doing homework, to cooking, to writing code, to entire software projects.They are actually awesome questions to ask during a software project.We discuss the questions, where they came from, and look at some uses in software.The questions:What is it that needs to be done?What do we need in order to do it?Where can we get what we need?How can we tell if we’re doing it right?Bonus question that can be swapped out for #1:What's the most important thing that it doesn't do yet?Links:The Four Questions

May 21, 2021 • 30min
154: Don't Mock your Database - Jeff Triplett
You need tests for your web app. And it has a database. What do you do with the database during testing? Should you use the real thing? or mock it? Jeff Triplett says don't mock it.In this episode, we talk with Jeff about testing web applications, specifically Django apps, and of course talk about the downsides of database mocking.Links:"🤔 In ~12 years, I have never seen a case where mocking a database was a good idea. ..." Django NewsMotoTest & Code 103: Django - Lacey Williams HenschelModel Bakery: Smart fixtures for better tests Faker

May 14, 2021 • 31min
153: Playwright for Python: end to end testing of web apps - Ryan Howard
Playwright is an end to end automated testing framework for web apps with Python support and even a pytest plugin.Links:Playwright for PythonWhy Playwright?playwright-pytest

May 7, 2021 • 49min
152: Python Packaging - Brett Cannon
I always learn a lot when I talk to Brett, and this episode is no exception. We talk about the packaging workflow, tools, changes, pyproject.toml, flit, setuptools, and so much more. I hope you learn as much as I did in this great discussion.Links:pytest-srcpathsPython Packaging User Guidepypa/packaging: Core utilities for Python packagesflit and requires-pythonExtending and Embedding the Python Interpreter — Python 3.9.2 documentationFlitsetuptoolsPEP 518 -- Specifying Minimum Build System Requirements for Python Projects | Python.orgPEP 517 -- A build-system independent format for source trees | Python.orgFlit editable installs with --symlink or --pth-filePEP 440 -- Version Identification and Dependency Specification | Python.orgSpecifying requires-python with flitwheelUniversal 1 binaryUniversal 2 binaryCython: C-Extensions for PythonCFFIpybind11: Seamless operability between C++11 and PythonCondaconda environmentsconda-forgeVaultsOfParnassus

Apr 28, 2021 • 56min
151: Python Adventure - Brandon Rhodes
Adventure, or Colossal Cave Adventure, was written between 1975 and 1977 in Fortran. Brandon Rhodes ported it to Python 3, initial release in 2011, and still maintains it. We talk to Brandon about this wonderful game.YOU ARE STANDING AT THE END OF A ROAD BEFORE A SMALL BRICK BUILDING.
AROUND YOU IS A FOREST. A SMALL STREAM FLOWS OUT OF THE BUILDING AND
DOWN A GULLY.
>>> east
A bit later...
IT IS NOW PITCH DARK. IF YOU PROCEED YOU WILL LIKELY FALL INTO A PIT.
>>> light(lamp)
YOUR LAMP IS NOW ON.
YOU ARE IN A DEBRIS ROOM FILLED WITH STUFF WASHED IN FROM THE SURFACE.
A LOW WIDE PASSAGE WITH COBBLES BECOMES PLUGGED WITH MUD AND DEBRIS
HERE, BUT AN AWKWARD CANYON LEADS UPWARD AND WEST. A NOTE ON THE WALL
SAYS ...
What's happening is that I'm playing adventure, which you can pip install thanks to Brandon Rohdes. Adventure is a faithful port to Python 3 from the original 1977 FORTRAN code by Crowther and Woods that lets you explore Colossal Cave, where others have found fortunes in treasure and gold, ...In this episode, we talk with Brandon Rhodes about this marvelous game.Links:adventure · PyPIpython-adventure: Original Colossal Caves adventure game, but in Python 3Brandon Rhodes Personal SitePython Design Patternspyephem: Scientific-grade astronomy routines for Pythonpython-skyfield: Elegant astronomy for PythonAdventure in Python 3 - announcement blog post from 2012NetHackFTL: Faster Than LightPEP 517 -- A build-system independent format for source trees | Python.org

Apr 15, 2021 • 10min
150: A Practical Testing Strategy
Coming up with a testing strategy doesn't have to be stressful. Prioritizing features to test, and generating test cases for each feature can be fairly quick and painless. This episode covers a strategy for both that can be applied to many types of software.

Mar 31, 2021 • 49min
149: I don't test my code, "crappy Python" is all I write - Corey Quinn
Corey Quinn is the Chief Cloud Economist at The Duckbill Group. He's also a podcaster and writes a newsletter. And he also automates things with Python. But he doesn't write tests. Let's find out why.Reason for the interview. Rough summary of a twitter conversation:Corey: What podcasts should I try to get an invite onto?ToonArmyCaptain: Python Bytes, Test & Code, Talk PythonCorey: But... I don't test my code, "crappy Python" is all I write, and I'd feel like a giant imposter. So yeah, I'd be game. linkSo here we are. This diagram is referenced in the show, the Last Week In AWS Newsletter Production Pipeline.Special Guest: Corey Quinn.Links:Last Week in AWS

Mar 12, 2021 • 13min
148: Coverage.py and testing packages
How do you test installed packages using coverage.py? Also, a couple followups from last week's episode on using coverage for single file applications. Links:episode 147: Testing Single File Python Applications/Scripts with pytest and coverageSpecifying source files — Coverage.py documentationTesting & Packaging - Hynekack