Python People podcast now at pythontest.com/pythonpeople
A new home for Python People
A collection of 65 Posts
The Test and Code podcast is in archive mode, and has moved here...
Brett Cannon recently released an article explaining Python 3.14's new t-strings. This article has pytest versions of the code from Brett's article.
I noticed a fun post by Ned Batchelder called "Testing some tidbits". The post looks at different ways to see if a string has only 0 or 1 in it. I'm expanding on that with some pytest code to test the different ways.
What are the top downloaded pytest plugins? I want to know this. And I'd like the answer updated regularly. So today I decided to write a script to do that for me.
Recapping some troubles I had when upgrading
Slides, link to video, and resources
A discussion of some ideas around Lean TDD from 2022. Lean TDD is an attempt to reconcile some conflicting aspects of Test Driven Development and Lean Software Development. I've mentioned Lean TDD on [the podcast][testandcode] a few times and even tried to do a quick outline at the end of [episode 162][flavors]. This post is a more complete outline, or at least a first draft.
This is the first iteration that implements ’expect’ as a fixture.
This is really the third attempt at an ’expect()’ implementation that …
Occasionally referred to as “Test First Development”, “Test First Programming” is a beautiful concept that radically changed the way I …
Further thoughts on the way to pytest-check
The start of thinking that led to pytest-check
Fixtures can only use other fixtures with equal or wider scope
We can use conftest.py to define fixtures that can be used by multiple files and still only run once per session
Running fixtures (and the tests that depend on them) multiple times with different values
Startup and teardown can surround functions, classes, modules/files, directories, or the entire test session.
If you want to apply a fixture to all tests in a class or file
Exactly what happens to the flow of your test code when an exception is thrown in a fixture function.
I made some enemies with this post
You can run some doctests from pytest, according to the documentation.
However, it can be a bit fiddly.
With my examples of putting doctests in text files, if I …
To show how pytest handles unittests, here’s a sample run of pytest on the simple unittests I wrote in the unittest introduction:
$ pytest …
I think of pytest as the run-anything, no boilerplate, no required api, use-this-unless-you-have-a-reason-not-to test framework.
This is really where testing …
The unittest test framework is python’s xUnit style framework.
It is a standard module that you already have if you’ve got python version 2.1 or …
The doctest test framework is a Python module that comes prepackaged with Python. This post covers the basics of how to put doctests in your code, and outside …
While writing software, we are faced with lots and lots of interfaces.
The public interface for some tool or module or package or whatever is usually referred …
To explore the concepts of functional testing using python and python testing frameworks, I’m building a project to test, markdown.py on github.
In this …
I’ve decided to write my own Markdown script,
possibly for dubious reasons.
I’m getting antsy to code.
But before I get started on the testing and …