Planet Python
Last update: June 29, 2025 10:42 AM UTC
June 27, 2025
Hugo van Kemenade
Run coverage on tests
I recommend running coverage on your tests.
Here’s a couple of reasons why, from the past couple of months.
Example one #
When writing tests, it’s common to copy and paste test functions, but sometimes you forget to rename the new one (see also: the Last Line Effect).
For example:
def test_get_install_to_run_with_platform(patched_installs):
i = installs.get_install_to_run("<none>", None, "1.0-32")
assert i["id"] == "PythonCore-1.0-32"
assert i["executable"].match("python.exe")
i = installs.get_install_to_run("<none>", None, "2.0-arm64")
assert i["id"] == "PythonCore-2.0-arm64"
assert i["executable"].match("python.exe")
def test_get_install_to_run_with_platform(patched_installs):
i = installs.get_install_to_run("<none>", None, "1.0-32", windowed=True)
assert i["id"] == "PythonCore-1.0-32"
assert i["executable"].match("pythonw.exe")
i = installs.get_install_to_run("<none>", None, "2.0-arm64", windowed=True)
assert i["id"] == "PythonCore-2.0-arm64"
assert i["executable"].match("pythonw.exe")
The tests pass, but the first one is never run because its name is redefined. This clearly shows up as a non-run test in the coverage report. In this case, we only need to rename one of them, and both are covered and pass.
But sometimes there’s a bug in the test which would cause it to fail, but we just don’t know because it’s not run.
Example two #
This is more subtle:
im = Image.new("RGB", (1, 1))
for colors in (("#f00",), ("#f00", "#0f0")):
append_images = (Image.new("RGB", (1, 1), color) for color in colors)
im_reloaded = roundtrip(im, save_all=True, append_images=append_images)
assert_image_equal(im, im_reloaded)
assert isinstance(im_reloaded, MpoImagePlugin.MpoImageFile)
assert im_reloaded.mpinfo is not None
assert im_reloaded.mpinfo[45056] == b"0100"
for im_expected in append_images:
im_reloaded.seek(im_reloaded.tell() + 1)
assert_image_similar(im_reloaded, im_expected, 1)
It’s not so obvious when looking at the code, but Codecov highlights a problem:
The append_images
generator is being consumed inside roundtrip()
, so we have nothing
to iterate over in the for
loop – hence no coverage. The
fix is to
use a list instead of a generator.
Header photo: Misplaced manhole cover (CC BY-NC-SA 2.0 Hugo van Kemenade).
Real Python
The Real Python Podcast – Episode #255: Structuring Python Scripts & Exciting Non-LLM Software Trends
What goes into crafting an effective Python script? How do you organize your code, manage dependencies with PEP 723, and handle command-line arguments for the best results? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder's Weekly articles and projects.
Luke Plant
Statically checking Python dicts for completeness
A Pythonic way to ensure that your statically-defined dicts are complete, with full source code.
PyPodcats
Episode 9: With Tamara Atanasoska
Learn about Tamara's journey. Tamara has been contributing to open source projects since 2012. She participated in Google Summer of Code to contribute to projects like Gnome and e-cidadania.
Django Weblog
Watch the DjangoCon Europe 2025 talks
They’re now all available to watch on YouTube, with a dedicated playlist ⭐️ DjangoCon Europe 2025 Dublin. For more quality Django talks in 2025, check out our next upcoming events!
All the DjangoCon Europe talks


































June 25, 2025
TestDriven.io
Building a Multi-tenant App with Django
This tutorial looks at how to implement multi-tenancy in Django.
Peter Bengtsson
Native connection pooling in Django 5 with PostgreSQL
Enabling native connection pooling in Django 5 gives me a 5.4x speedup.
Real Python
Your Guide to the Python print() Function
Learn how Python's print() function works, avoid common pitfalls, and explore powerful alternatives and hidden features that can improve your code.
Mike Driscoll
An Intro to ty – The Extremely Fast Python type checker
Ty is a brand new, extremely fast Python type checker written in Rust from the fine folks at Astral, the makers of Ruff. Ty is in preview and is not ready for production use, but you can still try it out on your code base to see how it compares to Mypy or other popular […]
The post An Intro to ty – The Extremely Fast Python type checker appeared first on Mouse Vs Python.
Real Python
Quiz: The Python print() Function
In this quiz, you'll test your understanding of Python's built-in print() function, covering how to format output, specify custom separators, and more.
PyPodcats
Trailer: Episode 9 With Tamara Atanasoska
A preview of our chat with Tamara Atanasoska. Watch the full episode on June 27, 2025
Talk Python to Me
#511: From Notebooks to Production Data Science Systems
If you're doing data science and have mostly spent your time doing exploratory or just local development, this could be the episode for you. We are joined by Catherine Nelson to discuss techniques and tools to move your data science game from local notebooks to full-on production workflows.
June 24, 2025
PyCoder’s Weekly
Issue #687: Scaling With Kubernetes, Substrings, Big-O, and More (June 24, 2025)
Real Python
Starting With DuckDB and Python
Learn how to use DuckDB in Python to query large datasets with SQL or its Python API, handle files like Parquet or CSV, and integrate with pandas or Polars.
June 23, 2025
Real Python
Python enumerate(): Simplify Loops That Need Counters
Learn how to simplify your loops with Python’s enumerate(). This tutorial shows you how to pair items with their index cleanly and effectively using real-world examples.
Daniel Roy Greenfeld
TIL: HTML 404 errors for FastAPI
For those times when FastAPI is serving web pages and users go to the wrong place.
Python Bytes
#437 Python Language Summit 2025 Highlights
Topics include The Python Language Summit 2025, Fixing Python Properties, complexipy, and juvio.
June 21, 2025
Will McGugan
Seeking sponsorship for Rich and Textual
After a somewhat stressful three years running a startup, I am takings a year's sabbatical. I'm going to use this time to focus on my health‐something I have neglected. As good as it feels not to work full-time, I still plan on maintaining Rich, Textual and other Open Source projects, in addition to offering free tech support.
Since I don't have any income at the moment, I want to start looking for sponsorship again. I'm hoping it will rise to a level where it will cover living costs for the year, but I'll be happy if it pays for coffee.
If you have benefited from my work in the past, consider sponsoring me. Whatever you feel comfortable with.
If your organization has extracted any value from my work, then consider picking one of the higher tiers to return the favor. I may be able to assist you with your project, wether it is terminal related or not. There is a lot of knowledge in my fleshy mammalian brain. Even in the age of AI, it could still benefit you.
Armin Ronacher
My First Open Source AI Generated Library
June 20, 2025
The Python Coding Stack
I Want to Remove Duplicates from a Python List • How Do I Do It?
Lists can have duplicate values. But sometimes, you don't want repeated items. Let's explore how to deal with this.
Ruslan Spivak
Book Notes: Full Frontal Calculus by Seth Braver — Chapter 1 Review
“Where there is life, there is change; where there is change, there is calculus.” — Seth Braver
I recently went back to studying math to rebuild my foundations for AI and machine learning. I didn’t expect to enjoy a calculus book this much. Shocking, I know. But that’s exactly …
Real Python
The Real Python Podcast – Episode #254: Scaling Python Web Applications With Kubernetes and Karpenter
What goes into scaling a web application today? What are resources for learning and practicing DevOps skills? This week on the show, Calvin Hendryx-Parker is back to discuss the tools and infrastructure for autoscaling web applications with Kubernetes and Karpenter.
June 19, 2025
EuroPython
June Newsletter: Last Chance for Tickets!
Hello, Pythonistas! 🐍
We added a lot of new subscribers since the last newsletter – if this is your first newsletter – Welcome! 🎉
TL;DR:
- Some of the tickets are sold out already 🎉
- We have a Python documentary premiere at EuroPython
- Memorial session for Michael Foord
- New sprints
PyCharm
Training Your ML Models With Cadence
In the rapidly evolving domains of machine learning (ML) and artificial intelligence (AI), the tools and technologies used by developers can significantly influence the speed, efficiency, and effectiveness of their projects. Recognizing this, we introduced Cadence in PyCharm 2025.1, a plugin that merges the ease of local development with advanced cloud computing capabilities. Why Cadence? […]
June 18, 2025
Talk Python Blog
New Theme Song: Served In A Flask
Those of you who were early listeners of Talk Python To Me might remember the amazing theme song we launched with: Developers, Developers, Developers by Smixx. Thanks to Smixx for letting us use his music for our intros.
Over the years, people have asked “What happened to the rap song”? I took it down for a couple of reasons not worth digging into but have definitely missed the fun and irreverant intro to the show.