Python Bytes

#444 Begone Python of Yore!

14 snips
Aug 11, 2025
Discover the fascinating world of regex pragmas in coverage.py, allowing for smarter code management. The importance of high code coverage is emphasized, along with tools for handling legacy Python compatibility. Dive into the implications of Pydantic deprecations and how they shape the future of development. Learn about the Nox testing tool for multi-version testing and efficient Django database migrations. Explore performance optimization strategies for SQLite and get updates on exciting new courses aimed at data scientists!
Ask episode
AI Snips
Chapters
Transcript
Episode notes
INSIGHT

Regex Pragmas Power Coverage.py

  • Coverage.py uses regex-based pragmas to flexibly mark code to exclude.
  • Brian Okken highlights its extensibility and plugin support.
ADVICE

Use Coverage Plugins For Common Exclusions

  • Install covdefaults to auto-exclude boilerplate and typing-related code.
  • Try coverage-conditional-plugin to exclude files by platform or installed packages.
INSIGHT

Multiline Pragmas Let You Exclude Blocks

  • Coverage.py 7.6 supports multiline regex pragmas to match whole files and code regions.
  • Use them to define start/stop no-cover blocks and exclude placeholders.
Get the Snipd Podcast app to discover more snips from this episode
Get the app