Episode notes
Test Driven Development. Red, Green, Refactor. Do we have to do the refactor part? Does the refactor at the end include tests? Or can I refactor the tests at any time? Why is refactor at the end? This episode is to talk about this with a an example.
More from Test & Code
-
E213 · 19 Jan 2024 · 14 min
213: Repeating Tests
If a test fails in a test suite, I'm going to want to re-run the test. I may even want to re-run a test, or a subset of the suite, a bunch of times. There are a few pytest plugins that help with this: pytest-repeat pytest-rerunfailures pytest-flakefinder pytest-instafail We talk about each of these in this episode.
-
E212 · 13 Jan 2024 · 8 min
212: Canon TDD - by Kent Beck
In 2002, Kent Beck released a book called "Test Driven Development by Example". In December of 2023, Kent wrote an article called "Canon TDD". With Kent's permission, this episode contains the full content of the article. Brian's commentary is saved for a followup episode. Links: Canon TDD Test Driven Development by Example
-
E211 · 15 Dec 2023 · 18 min
211: Stamp out test dependencies with pytest plugins
We want to be able to run tests in a suite, and debug them in isolation, and have the behavior be the same. If the behavior is different in isolation vs in a suite, it's a nightmare to debug. In this episode, we'll talk about: Causes of dependence Testing for dependencies using plugins Debugging test dependencies Plugins discussed: pytest-randomly pytest-reverse pytest-random-order
-
E209 · 16 Nov 2023 · 16 min
209: Testing argparse Applications
How do you test the argument parsing bit of an application that uses argparse? This episode covers: Design for Test: Structuring your app or script so it's easier to test. pytest & capsys for testing stdout Adding debug and preview flags for debugging and testing And reverting to subprocess.run if you can't modify the code under test Also, there's a full writeup and code samples available: Blog post: Testing argparse Applications Code Repo
-
E238 · 15 Aug 2025 · 2 min
238: So Long, and Thanks for All the Fish
A farewell to a fun 10 years. Also, I should have tested it better. :) In the audio I got the numbers wrong. Doh! This is episode 238, not 237. Oh well. I'll still be around, of course, at: pythontest.com - where I write about developing software with tests pythonbytes.fm - Python news and headlines, delivered directly to your earbuds Thanks for all the fun over the last 10 years. I wish you the best.
-
E237 · 11 Aug 2025 · 36 min
237: FastAPI Cloud - Sebastián Ramírez
In this episode, Brian interviews Sebastián Ramírez, creator of FastAPI, about its rapid rise in developer popularity and the launch of FastAPI Cloud. Sebastian explains how FastAPI Cloud addresses deployment challenges small teams face. He shares his transition from open-source to startup founder, focusing on simplifying deployment against the complexity of tools like Kubernetes. Links: FastAPI Cloud FastAPI SQLModel Typer OpenAPI Pydantic Sequoia Open Source Fellowship
-
E236 · 30 Jul 2025 · 20 min
236: Git Tips for Testing - Adam Johnson
In this episode, host Brian Okken and guest Adam Johnson explore essential Git features, highlighted by Adam's updated book, "Boost Your Git DX." Key topics include "cherry picking" for selective commits "git stash" for managing in-progress work "git diff", and specifically its `--name-only` flag, which provides a streamlined method for developers to identify which files have changed, which can be used to determine which tests need to be run "git bisect" for efficiently pinpointing bugs. This conversation offers valuable strategies for developers at any skill level to enhance their Git…
-
E235 · 22 Jul 2025 · 20 min
235: pytest-django - Adam Johnson
In this episode, special guest Adam Johnson joins the show and examines pytest-django, a popular plugin among Django developers. He highlights its advantages over the built-in unittest framework, including improved test management and debugging. Adam addresses transition challenges, evolving fixture practices, and offers tips for optimizing test performance. This episode is a concise guide for developers looking to enhance their testing strategies with pytest-django. Links: pytest-django - a plugin for pytest that provides a set of useful tools for testing Django applications and projects.
-
E234 · 8 May 2025 · 7 min
234: pytest-metadata - provides access to test session metadata
pytest-metadata is described as a plugin for pytest that provides access to test session metadata. That is such a humble description for such a massively useful plugin. If you're already using pytest-html, you have pytest-metadata already installed, as pytest-metadata is one of the dependencies for pytest-html. However, pytest-metadata is very useful even on its own. Links: pytest-metadata - The plugin we're talking about in this episode pytest-base-url - Adds the base URL to the metadata. pytest-html - Displays the metadata at the start of each report. See S2:E6: pytest-html - a plugin that…
-
E233 · 2 May 2025 · 9 min
233: pytest-check - allow multiple failures per test
pytest-check is a pytest plugin that allows multiple failures per test. Normally, a test function will fail and stop running with the first failed assert. That's totally fine for tons of kinds of software tests. However, there are times where you'd like to check more than one thing, and you'd really like to know the results of each check, even if one of them fails. pytest-check allows multiple failed "checks" per test function, so you can see the whole picture of what's going wrong. Links: pytest-check Top pytest plugins
