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. pytes...
May 08, 2025•8 min•Season 2Ep. 11
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: pytes...
May 02, 2025•10 min•Season 2Ep. 10
AI is helping people write code. Tests are one of those things that some people don't like to write. Can AI play a role in creating automated software tests? Well, yes. But it's a nuanced yes. Anthony Shaw comes on the show to discuss the topic and try to get AI to write some test for my very own cards project. We discuss: The promise of AI writing your tests for you Downsides to not writing tests yourself Bad ways to generate tests Good ways to ask AI for help in writing tests Tricks to get bet...
Apr 25, 2025•58 min•Season 2Ep. 9
pytest-repeat is a pytest plugin that makes it easy to repeat a single test, or multiple tests, a specific number of times. works fine on Python 3.14 is tested on Python 3.9-3.14 probably works fine still on 3.7 & 3.8 This episode also discusses the attempted April Fools episode. Links: pytest-repeat The April Fools episode: Python 3.14 won't repeat with pytest-repeat Help support the show AND learn pytest: The Complete pytest course is now a bundle, with each part available separately. pyte...
Apr 10, 2025•8 min•Season 2Ep. 8
pytest-repeat is a pytest plugin that makes it easy to repeat a single test, or multiple tests, a specific number of times. Note: This was an April Fools attempt, so the statement ... "Unfortunately, it doesn't seem to work with Python 3.14, even though there is no rational reason why it shouldn't work." ... is NOT true. Listen to the NEXT episode to get an explanation Links: pytest-repeat Next episode: pytest-repeat - works fine on Python 3.14 Help support the show AND learn pytest: The Complet...
Apr 01, 2025•5 min•Season 2Ep. 7
pytest-html has got to be one of my all time favorite plugins. pytest-html is a plugin for pytest that generates a HTML report for test results. This episode digs into some of the super coolness of pytest-html. pytest-html repo readme with screenshot enhancing reports pytest-metadata Help support the show AND learn pytest: The Complete pytest course is now a bundle, with each part available separately. pytest Primary Power teaches the super powers of pytest that you need to learn to use pytest e...
Mar 27, 2025•7 min•Season 2Ep. 6
Markdown reports as either text or markdown tables. Two fun plugins discussed. Links: pytest-md-report pytest-md Top pytest Plugins Help support the show AND learn pytest: The Complete pytest course is now a bundle, with each part available separately. pytest Primary Power teaches the super powers of pytest that you need to learn to use pytest effectively. Using pytest with Projects has lots of "when you need it" sections like debugging failed tests, mocking, testing strategy, and CI Then pytest...
Mar 01, 2025•11 min•Season 2Ep. 5
This episode is a replay of a 2021 interview I did with Michael Foord. We lost Michael in January, and I'd like to revisit this interview as a tribute. Michael Foord was a pivotal figure in the Python community and the creator of the mock library that's now unittest.mock. But he did so much more as well. His contributions continue to resonate within the developer community. This interview is just a small peek at his influence. In this episode Introduction to Michael Foord The Mock Library Origin...
Feb 07, 2025•48 min•Season 2Ep. 4
pytest-mock is currently the #3 pytest plugin. pytest-mock is a wrapper around unittest.mock. In this episode: Why the pytest-mock plugin is awesome What is mocking, patching, and monkey patching What, if any, is the difference between mock, fake, spy, stub. Why we might need these in testing Some history of mock in Python and how mock became unittest.mock From unittest.mock patch.object patch.object with autospec using these as context managers pytest-mock: The mocker fixture Cleanup in teardow...
Jan 31, 2025•12 min•Season 2Ep. 3
pytest-cov is a pytest plugin that helps produce coverage reports using Coverage.py. In this episode, we'll discuss: what Coverage.py is why you should measure code coverage on both your source and test code what pytest-cov is extra features pytest-cov gives you over and above coverage.py and generally why using both is awesome Links: coverage.py pytest-cov how to set up context reports Top pytest Plugins Errata: I mentioned that Coverage has the ability to show context (which line is covered by...
Jan 23, 2025•13 min•Season 2Ep. 2
This episode kicks off a season of pytest plugins. In this episode: Introduction to pytest plugins The pytest.org pytest plugin list Finding pytest related packages on PyPI The Top pytest plugins list on pythontest.com Exploring popular plugins Learning from plugin examples Links: Top pytest plugins list pytest.org plugin list Top PyPI Packages And links to plugins mentioned in the show can be found at pythontest.com/top-pytest-plugins Help support the show AND learn pytest: The Complete pytest ...
Jan 10, 2025•13 min•Season 2Ep. 1
Taking notes well can help to listen better, remember things, show respect, be more accountable, free up mind space to solve problems. This episode discusses the benefits of writing things down preparing for a meeting taking notes in meetings reviewing notes for action items, todo items, things to follow up on, etc. taking notes to allow for better focus writing well structured emails writing blog posts and books Help support the show AND learn pytest: The Complete pytest course is now a bundle,...
Nov 17, 2024•22 min•Season 1Ep. 223
In this episode we're talking about importing part of a package into another part of the same package. We'll look at: `from . import module` and `from .module import something` and also: `import package` to access the external API from with the package. Why would we use `import package` if `from . import api` would work fine? Help support the show AND learn pytest: The Complete pytest course is now a bundle, with each part available separately. pytest Primary Power teaches the super powers of py...
Sep 07, 2024•13 min•Season 1Ep. 222
We've got some code we want to test, and some tests. The tests need to be able to import the code under test, or at least the API to it, in order to run tests against it. How do we do that? How do we set things up so that our tests can import our code? In this episode, we discuss two options: Installing the code under test as a pip installable package with `pip install -e /path/to/local/package`. Using the pythonpath pytest setting . Help support the show AND learn pytest: The Complete pytest co...
Jun 03, 2024•8 min•Season 1Ep. 221
PyCon US is just around the corner. I've asked Rob Ludwick to come on the show to discuss how to get the most out of your PyCon experience. There's a lot to do. A lot of activities to juggle, including actual juggling, which is where we start the conversation. Even if you never get a chance to go to PyCon, I hope this interview helps you get a feel for the welcoming aspect of the Python community. I recorded this interview as an episode for one of my other podcasts, Python People. But I think it...
May 04, 2024•41 min•Season 1Ep. 220
I'm starting a SaaS project using Django, and there are tons of decisions right out of the gate. To help me navigate these decisions, I've brought on Cory Zue. Cory is the creator of SaaS Pegasus , and has tons of experience with Django. Some of the topics discussed: Building Django applications SaaS Pegasus placecard.me What boilerplate projects are Django cookiecutter Cookiecutter Which database to use, probably PostgreSQL Authentication choises, probably Allauth Docker, Docker for development...
Apr 24, 2024•49 min•Season 1Ep. 219
Nicole is a software engineer and writer, and recently wrote about the trade-offs we make when deciding which tests to write and how much testing is enough. We talk about: Balancing schedule vs testing How much testing is the right about of testing Should code coverage be measured and tracked Good refactoring can reduce code coverage Is it worth testing error conditions? Are rare error codes ok to just monitor? API drift and autospec Mitigating risk Deciding what to test and what not to test Foc...
Apr 18, 2024•29 min•Season 1Ep. 218
If you've ever thought about starting a podcast or a SaaS project, you'll want to listen to this episode. Justin is one of the people who motivated me to get started podcasting. He's also running a successful SaaS company, transistor.fm , which hosts this podcast. Topics: Podcasting Building new SaaS (software as a service) products Balancing work, side hustle, and family Great places to snowboard in British Columbia BTW. This episode was recorded last summer before I switched to transistor.fm ....
Apr 11, 2024•57 min•Season 1Ep. 217
Charlie Marsh and team are using Rust to make Python tooling faster. Ruff can take the place of Flake8, isort, and Black, and so much more. uv can take the place of pip, pip-tools, and virtualenv Astral is Charlie's venture backed company, and what they have with `ruff` and `uv` is just the start. Since uv is the newest tool, there's quite a bit of the discussion diving into uv. Links: ruff Astral uv Help support the show AND learn pytest: The Complete pytest course is now a bundle, with each pa...
Mar 11, 2024•49 min•Season 1Ep. 216
Software engineers that move into leadership roles have a struggle between learning leadership skills, maintaining technical skills, and learning new leadership and technical skills. Matt Makai went from individual contributor to developer relations to leadership in devrel. We discuss how to stay technical, as well as dive into some results of his studies in how companies use developer relationship channels. Help support the show AND learn pytest: The Complete pytest course is now a bundle, with...
Feb 25, 2024•40 min•Season 1Ep. 215
If you haven't tried running automated tests, especially with pytest, in VS Code recently, you should take another look. The Python for VS Code interface for testing, especially for pytest, has changed recently. On this episode we discuss the change with the software engineer working on the pytest changes, Eleanor Boyd, and the product manager, Courtney Webster. Links from the episode: Blog post announcing the rewrite Code repo for questions, comments, issues etc Help support the show AND learn ...
Feb 07, 2024•39 min•Season 1Ep. 214
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. Help support the show AND learn pytest: The Complete pytest course is now a bundle, with each part available separately. pytest Primary Power teaches the super powers of pytest that y...
Jan 19, 2024•14 min•Season 1Ep. 213
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 Help support the show AND learn pytest: The Complete pytest course is now a bundle, with each part available separately. pytest Primary Power teaches the super powers of pyte...
Jan 13, 2024•8 min•Season 1Ep. 212
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 Help support the show AND learn pytest: The Complete pytest course is now a bundle, with each part available separa...
Dec 15, 2023•19 min•Season 1Ep. 211
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. Help support the show AND learn pytest: The Complete pytest course is now a bundle, with each part available separately. pytest Primary Power teaches the super powers of pytest that you need to learn to use pytest effectively. Using pytest with Proje...
Nov 30, 2023•17 min•Season 1Ep. 210
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 Help support the show AND learn pytest: The Complete...
Nov 16, 2023•17 min•Season 1Ep. 209
Why on earth would you want to write a test with no assert statements? After all, aren't assert statements how you decide wether a test passes or fails? In this episode, we walk through a handful of useful examples of test code without asserts. We also talk about how these types of tests are a great way to dip your toe into testing. Help support the show AND learn pytest: The Complete pytest course is now a bundle, with each part available separately. pytest Primary Power teaches the super power...
Oct 30, 2023•13 min•Season 1Ep. 208
New course: "The Complete pytest Course" pytest-repeat , which I'm starting to contribute to Give `--repeat-scope` a try. You can use it to change from repeating every test to repeating the session, module, or class. pytest-flakefinder , which is an alternative to pytest-repeat pytest-check is completely unrelated, but mentioned in the show Help support the show AND learn pytest: The Complete pytest course is now a bundle, with each part available separately. pytest Primary Power teaches the sup...
Sep 26, 2023•14 min•Season 1Ep. 207
TDD (Test Driven Development) started from Test First Programming, and has been around at least since the 90's. However, software tools and available CI systems have changed quite a bit since then. Maybe it's time to re-examine the assumptions, practices, processes, and principles of TDD. At least in the context of my software engineering career, modifications to TDD, at least the version of TDD as it's frequently taught, have been necessary. This is the start of a series focused on examining TD...
Aug 23, 2023•21 min•Season 1Ep. 206
On a recent episode of PythonBytes, I suggested it's hard to come up with good examples for pytest autouse fixtures, as there aren't very many good reasons to use them. James Falcon was kind enough to reach out and correct me. In this episode, we describe: what fixtures are what autouse fixtures are great reasons to use them Help support the show AND learn pytest: The Complete pytest course is now a bundle, with each part available separately. pytest Primary Power teaches the super powers of pyt...
Aug 01, 2023•30 min•Season 1Ep. 205