Python Bytes - #436 Slow tests go last

Topics covered in this episode:
Watch on YouTube

About the show

Sponsored by PropelAuth: pythonbytes.fm/propelauth66

Connect with the hosts

Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am PT. Older video versions available there too.

Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it.

Brian #1: Free-threaded Python no longer “experimental” as of Python 3.14

  • “PEP 779 ("Criteria for supported status for free-threaded Python") has been accepted, which means free-threaded Python is now a supported build!” - Hugo van Kemenade
  • PEP 779 – Criteria for supported status for free-threaded Python
  • As noted in the discussion of PEP 779, “The Steering Council (SC) approves PEP 779, with the effect of removing the “experimental” tag from the free-threaded build of Python 3.14.”
  • We are in Phase II then.
  • “We are confident that the project is on the right path, and we appreciate the continued dedication from everyone working to make free-threading ready for broader adoption across the Python community.”
  • “Keep in mind that any decision to transition to Phase III, with free-threading as the default or sole build of Python is still undecided, and dependent on many factors both within CPython itself and the community. We leave that decision for the future.”
  • How long will all this take? According to Thomas Wouters, a few years, at least: “In other words: it'll be a few years at least. It can't happen before 3.16 (because we won't have Stable ABI support until 15) and may well take longer.”

Michael #2: typed-ffmpeg

  • typed-ffmpeg offers a modern, Pythonic interface to FFmpeg, providing extensive support for complex filters with detailed typing and documentation.

  • Inspired by ffmpeg-python, this package enhances functionality by addressing common limitations, such as lack of IDE integration and comprehensive typing, while also introducing new features like JSON serialization of filter graphs and automatic FFmpeg validation.

  • Features :

    • Zero Dependencies: Built purely with the Python standard library, ensuring maximum compatibility and security.
    • User-Friendly: Simplifies the construction of filter graphs with an intuitive Pythonic interface.
    • Comprehensive FFmpeg Filter Support: Out-of-the-box support for most FFmpeg filters, with IDE auto-completion.
    • Integrated Documentation: In-line docstrings provide immediate reference for filter usage, reducing the need to consult external documentation.
    • Robust Typing: Offers static and dynamic type checking, enhancing code reliability and development experience.
    • Filter Graph Serialization: Enables saving and reloading of filter graphs in JSON format for ease of use and repeatability.
    • Graph Visualization: Leverages graphviz for visual representation, aiding in understanding and debugging.
    • Validation and Auto-correction: Assists in identifying and fixing errors within filter graphs.
    • Input and Output Options Support: Provide a more comprehensive interface for input and output options, including support for additional codecs and formats.
    • Partial Evaluation: Enhance the flexibility of filter graphs by enabling partial evaluation, allowing for modular construction and reuse.
    • Media File Analysis: Built-in support for analyzing media files using FFmpeg's ffprobe utility, providing detailed metadata extraction with both dictionary and dataclass interfaces.

Michael #3: pyleak

  • Detect leaked asyncio tasks, threads, and event loop blocking with stack trace in Python. Inspired by goleak.
  • Use as context managers or function dectorators
  • When using no_task_leaks, you get detailed stack trace information showing exactly where leaked tasks are executing and where they were created.
  • Even has great examples and a pytest plugin.

Brian #4: Optimizing Test Execution: Running live_server Tests Last with pytest

  • Tim Kamanin

  • “When working with Django applications, it's common to have a mix of fast unit tests and slower end-to-end (E2E) tests that use pytest's live_server fixture and browser automation tools like Playwright or Selenium. ”

  • Tim is running E2E tests last for

    • Faster feedback from quick tests
    • To not tie up resources early in the test suite.
  • He did this with

    • custom “e2e” marker

    • Implementing a

      pytest_collection_modifyitems
      

      hook function to look for tests using the

      live_server
      

      fixture, and for them

      • automatically add the e2e marker to those tests
      • move those tests to the end
  • The reason for the marker is to be able to

    • Just run e2e tests with -m e2e
    • Avoid running them sometimes with -m "not e2e"
  • Cool small writeup.

    • The technique works for any system that has some tests that are slower or resource bound based on a particular fixture or set of fixtures.

Extras

Brian:

Michael:

Joke: Naming is hard

NBN Book of the Day - Ben Snyder on Spy Plane: Inside Baltimore’s Surveillance Experiment

In this 100th episode (!!!) of Peoples & Things, host, Lee Vinsel, talks with Benjamin H. Snyder, Associate Professor of Sociology at Williams College, about his recent book, Spy Plane: Inside Baltimore’s Surveillance Experiment (University of California Press, 2024). Spy Plane examines how the city of Baltimore, Maryland, came to adopt a corporate-run surveillance program using aerial surveillance planes that could supposedly photograph and track every person in public. Snyder bases his account on incredible access and direct observations inside the for-profit tech startup that ran the program. He also examines the complex reactions of community members in the neighborhoods that were surveilled and how the program eventually fell to pieces.

Learn more about your ad choices. Visit megaphone.fm/adchoices

Support our show by becoming a premium member! https://newbooksnetwork.supportingcast.fm/book-of-the-day

New Books in Native American Studies - L. Sasha Gora, “Culinary Claims: Indigenous Restaurant Politics in Canada” (University of Toronto Press, 2025)

Culinary Claims: Indigenous Restaurant Politics in Canada (University of Toronto Press, 2025) by Dr. L. Sasha Gora explores the complex relationships between wild plants and introduced animals, Indigenous foodways, and Canadian regulations. Blending food studies with environmental history, the book examines how cuisines reflect social and political issues related to cultural representation, restaurants, and food sovereignty.

Dr. Gora chronicles the rise of Indigenous restaurants and their influence on Canadian food culture, engaging with questions about how shifts in appetite reflect broader shifts in imaginations of local environments and identities. Drawing on a diverse range of sources – from recipes and menus to artworks and television shows – the book discusses both historical and contemporary representations of Indigenous foodways and how they are changing amid the relocalization of food systems.

Culinary Claims tells a new story of settler colonialism and Indigenous resistance, emphasizing the critical role that restaurants play in Canada’s cultural landscape. It investigates how food shapes our understanding of place and the politics that underpin this relationship. Ultimately, the book asks, What insights can historians gain from restaurants – and their legacies – as reflections of Indigenous and settler negotiations over cultural claims to land?

Culinary Claims presents a comprehensive history of Indigenous restaurants in Canada, highlighting their significant role in the evolution of Canadian food culture.

This interview was conducted by Dr. Miranda Melcher whose book focuses on post-conflict military integration, understanding treaty negotiation and implementation in civil war contexts, with qualitative analysis of the Angolan and Mozambican civil wars. You can find Miranda’s interviews on New Books with Miranda Melcher, wherever you get your podcasts.

Learn more about your ad choices. Visit megaphone.fm/adchoices

Support our show by becoming a premium member! https://newbooksnetwork.supportingcast.fm/native-american-studies

Strict Scrutiny - Can Trump Mobilize the Military Without California’s Consent?

Melissa, Kate, and Leah can smell the fascism in the air as President Trump forces troops on California protesters. They discuss how he is (yet again) pushing the boundaries of authoritarianism, provide an update on the Kilmar Abrego Garcia case, and unpack another flurry of Supreme Court Opinions. Then, they talk trans rights with Chase Strangio, deputy director for transgender justice and staff attorney with the ACLU. Finally, a bit of fun with a game about iconic breakups–political and otherwise. This episode was recorded live from Sony Hall in New York City. 

Hosts’ favorite things:
Kate: “How 2000s Culture Messed Us Up”, (The Culture Study Podcast); “Delay, Interfere, Undermine”, T. Christian Miller and Sebastian Rotella (ProPublica); Federalizing the California National Guard, Steve Vladek (One First)

Leah: This Is What Autocracy Looks Like, Michelle Goldberg (NYT); Argent, who dressed the hosts for the show

Melissa: What the Hell Is Posse Comitatus Anyway? Elie Mystal (The Nation); The Better Sister (Prime Video); Sarah Sclarandis’ shoes

Get tickets for STRICT SCRUTINY LIVE – The Bad Decisions Tour 2025! 

  • 10/4 – Chicago

Learn more: http://crooked.com/events

Order your copy of Leah's book, Lawless: How the Supreme Court Runs on Conservative Grievance, Fringe Theories, and Bad Vibes

Follow us on Instagram, Threads, and Bluesky

What A Day - Sustaining The Movement After No Kings

In towns and cities across the country, from blue cities to red states, from Idaho to Georgia and pretty much everywhere else, folks gathered to show their opposition to the Trump Administration. They were standing up against immigration raids with masked federal agents, to devastating cuts to Medicaid, to the President of the United States, quote-unquote “honoring” the United States Army with a birthday parade. If you marched this weekend with hundreds (or even thousands) of your neighbors, what can you do to keep that energy going? We asked Maurice Mitchell, the national director of the Working Families Party.

And in headlines: Israeli Prime Minister Benjamin Netanyahu launched a preemptive strike against Iran, Minnesota lawmakers were shot and killed in a suspected political assassination, and the Trump administration proposes an expansion of the travel ban.

 

Show Notes:


 

The NewsWorthy - MN Lawmaker Shootings, Flash Flooding & Live-Action Summer- Monday, June 16, 2025

The news to know for Monday, June 16, 2025!

We're telling you about the fourth straight day of fighting between Israel and Iran and how the U.S. plans to de-escalate the situation.

And President Trump's big military parade in Washington, D.C. was overshadowed by nationwide mass protests and some tragic political violence. 

Plus, severe storms got in the way of big events, prices for popular attractions have been constantly changing, and a group of British celebrities has been knighted.

Those stories and even more news to know in about 10 minutes! 

 

Join us every Mon-Fri for more daily news roundups! 

See sources: https://www.theNewsWorthy.com/shownotes

Become an INSIDER to get AD-FREE episodes here: https://www.theNewsWorthy.com/insider

Get The NewsWorthy MERCH here: https://thenewsworthy.dashery.com/

Sponsors:

Skylight is offering our listeners $30 off their 15 inch Calendars by going to SkylightCal.com/newsworthy

Fatty15 is offering an additional 15% off their 90-day subscription Starter Kit by going to fatty15.com/NEWSWORTHY and using code NEWSWORTHY at checkout.

To advertise on our podcast, please reach out to ad-sales@libsyn.com

 

 

WSJ Your Money Briefing - The Underestimated Cost of Healthcare in Retirement

As retirees get older, they could face additional costs including medication and doctors visits that could add tens of thousands of dollars to out-of-pocket expenses. Host Oyin Adedoyin talks with WSJ contributor Gail Marks Jarvis about how to prepare for unanticipated healthcare expenses in retirement.   


Sign up for the WSJ's free Markets A.M. newsletter

Learn more about your ad choices. Visit megaphone.fm/adchoices

The Best One Yet - 🪖“Army’s GeekSquad” — US Military’s Tech Recruits. Converse’s MJ moment. Din Tai Fung’s dumpling empire.

The best player in the NBA Finals wears Converse… so they launched a sneaker dating show?

War in the Middle East means the US Army has a new recruit… Palantir, Meta, and OpenAI.

Din Tai Fung is now the most lucrative restaurant chain in the US… because of 1 lucky number.

Plus, Summer Fridays are disappearing… so happy Summer Monday. 


$MSFT $AAPL $NKE


Want more business storytelling from us? Check out the latest episode of our new weekly deepdive show: The untold origin story of… Beanie Babies 🧸


Subscribe to The Best Idea Yet: Wondery.fm/TheBestIdeaYetLinks to listen.


TBOY Live Show Tickets to Chicago on sale NOW: https://www.axs.com/events/949346/the-best-one-yet-podcast-tickets


About Us: The daily pop-biz news show making today’s top stories your business. Formerly known as Robinhood Snacks, TBOY Lite is hosted by Jack Crivici-Kramer & Nick Martell.


GET ON THE POD: 

Submit a shoutout or fact: https://tboypod.com/shoutouts 


NEWSLETTER:

https://tboypod.com/newsletter 


SOCIALS:

Instagram: https://www.instagram.com/tboypod 

TikTok: https://www.tiktok.com/@tboypod

YouTube: https://www.youtube.com/@tboypod 


Anything else: https://tboypod.com/ 


Our 2nd show… 

The Best Idea Yet: Wondery.fm/TheBestIdeaYetLinks

Episodes drop weekly.



See Privacy Policy at https://art19.com/privacy and California Privacy Notice at https://art19.com/privacy#do-not-sell-my-info.

WSJ Tech News Briefing - Inside the Effort to Reboot America’s Nuclear Energy Program

Since 2021, more than $2-billion of venture capital funds have been plowed into next-gen nuclear technology. WSJ tech and national security reporter Heather Somerville explains how AI growth, competition with China, and President Trump’s desire to dominate the field are ushering in a new era of American nuclear power. Plus, we all need a shoulder to cry on or an empathetic ear once in a while. What if that reassurance came from a digital companion? WSJ family and tech columnist Julie Jargon talks to NYC seniors about whether such conversations are helpful. 


Sign up for the WSJ's free Technology newsletter.

Learn more about your ad choices. Visit megaphone.fm/adchoices

NPR's Book of the Day - As prime minister of New Zealand, Jacinda Ardern juggled leadership and motherhood

In 2017, Jacinda Ardern was sitting in a bathroom waiting to learn two things: whether she was going to be the prime minister of New Zealand – and whether she was pregnant. Ardern became only the second person in history to give birth while holding elected office at the top of government. And as prime minister, she had few people to turn to for advice on balancing the challenges of motherhood with leading a country. In today's episode, Ardern joins NPR's Mary Louise Kelly for a conversation about her new memoir A Different Kind of Power. They discuss what it was like to be a young woman running a country, the way Ardern has experienced parental guilt inside and outside of her political career, and how she knew when it was time to leave office.

To listen to Book of the Day sponsor-free and support NPR's book coverage, sign up for Book of the Day+ at plus.npr.org/bookoftheday

Learn more about sponsor message choices: podcastchoices.com/adchoices

NPR Privacy Policy