release-2.6.0.rst

Overview

This file documents the release notes and key changes introduced in **pytest version 2.6.0**, a mature Python testing framework. The release focuses on improvements in traceback reporting, a new internal warning system, enhanced integration with other testing utilities (nose, mock, unittest), and multiple bug fixes.

The document serves as both an announcement and a detailed changelog, outlining new features, bug fixes, internal improvements, and contributor acknowledgements. It is intended for users upgrading from previous pytest versions (notably 2.5.2) and for developers interested in the evolution of pytest’s core functionality.

Key highlights of this release include:

Detailed Documentation

New Features and Changes

Shorter Tracebacks by Default

New Warning System

Integration Enhancements

Bug Fixes and Improvements

Usage Examples

**Running tests with shorter tracebacks (default in 2.6.0):**

pytest tests/

**Running tests with full long tracebacks:**

pytest --tb=long tests/

**Running a single test by node ID (includes file, class, method, line number):**

pytest path/to/test_module.py::TestClass::test_method

**Report warnings in detail:**

pytest -rw tests/

Important Implementation Details

Interaction with Other Components

Mermaid Diagram

The file is primarily a changelog and does not define classes or functions directly, but it references core pytest components such as the warning system and traceback formatting. Below is a flowchart representing the major functional areas affected in this release and their interactions.

flowchart TD
    A[pytest Test Runner] --> B[Test Collection]
    B --> C[Warning System]
    B --> D[Traceback Formatter]
    C --> E[pytest_logwarning Hook]
    E --> F[Terminal Plugin]
    D --> F
    A --> G[Fixture Finalizers]
    G --> H[Invalidation Handling]
    A --> I[Integration Modules]
    I --> J[nose/unittest Support]
    I --> K[mock Support]
    style A fill:#f9f,stroke:#333,stroke-width:2px
    style C fill:#bbf,stroke:#333
    style D fill:#bbf,stroke:#333
    style E fill:#bfb,stroke:#333
    style F fill:#bfb,stroke:#333
    style G fill:#ffb,stroke:#333
    style I fill:#fbf,stroke:#333

This diagram shows how the pytest test runner coordinates test collection, which triggers the warning system and traceback formatting, both of which feed information to the terminal plugin for user display. Fixture finalizers and integration modules enhance test lifecycle management and compatibility with other testing frameworks.


**Summary:** This release note file for pytest 2.6.0 comprehensively communicates the new features, bug fixes, and internal improvements to users and developers. It primarily focuses on enhancing test failure readability, introducing a structured internal warning system, and improving compatibility with external test tools—all while maintaining backward compatibility with prior pytest versions.