Python Testing Tools, TUI Dashboards, and PEPs

·25m 29s
Shared point

Software Development and Testing Tools

Snapshot Testing in Python

The episode explores the utility of inline snapshots in PyTest. By embedding expected output directly within test files rather than external storage, developers can simplify the maintenance of complex data structures.
Inline Snapshot: A tool that fixes test data in place, allowing for easy manual inspection during refactoring.
Syrupy: An alternative for snapshot testing requiring external files.
Dirty-equals: A library useful for flexible assertion logic.

Jolt: TUI for System Monitoring

Jolt provides a visually intuitive terminal interface for monitoring battery health, energy consumption, and process-level resource tracking on macOS and Linux.

"Real-time power monitoring, process energy tracking, battery health insights all in your terminal."

Expanding Ruff Formatting

Ruff now includes experimental support for formatting Markdown files, targeting code blocks defined by language identifiers.
Preview Mode: The feature must be enabled via pyproject.toml or CLI flags.
Safety: Includes mechanisms to disable formatting for specific segments to preserve demonstration code.

Workflow Automation

Running GitHub Actions Locally with Act

To avoid latency and costs associated with CI/CD runners, developers can utilize act to execute GitHub Actions locally within Docker containers.

Python Ecosystem Updates

PEP 814 and Frozen Dictionaries

The Python Steering Council has accepted PEP 814, which introduces "frozen dictionaries" to the language.
Immutability: Designed to boost concurrency performance by removing the need for locking in thread-safe contexts.
Target Release: Expected in Python 3.15.

Django ORM Standalone

There is growing interest in using the Django ORM independently of the full Django framework, allowing developers to leverage its mature data modeling capabilities in diverse applications, such as FastAPI or standalone automation scripts.

Topics

Chapters

6 chapters
Python Bytes
AI chat — answers grounded in episodes