release-2.7.1.rst
Overview
This file is the release notes documentation for **pytest version 2.7.1**, a widely used Python testing framework. It provides a concise summary of bug fixes and improvements made since the previous version (2.7.0). The document serves as an official changelog and upgrade guide for users and contributors, highlighting key resolved issues, development acknowledgments, and instructions for obtaining the update.
pytest is known for its simplicity and powerful features to write unit and functional tests in Python. Version 2.7.1 maintains backward compatibility with 2.7.0 while addressing important bug fixes and optimizations.
Purpose & Functionality
Communicates important bug fixes and improvements in pytest 2.7.1.
Guides users on how to upgrade pytest via pip.
Credits contributors involved in the release.
Links to official documentation for further reference.
Provides transparency about internal changes, such as release process and versioning improvements.
This file is primarily informational and does not contain executable code or classes but is essential for developers and testers relying on pytest to understand changes and ensure smooth upgrades.
Detailed Breakdown
Release Version and Compatibility
Version: 2.7.1
Compatibility: Drop-in replacement for pytest 2.7.0, ensuring no breaking changes.
Upgrade Instructions
Users can upgrade pytest via PyPI using the command:
pip install -U pytest
Bug Fixes and Issues Addressed
Each bullet lists an issue number and a brief summary of the fix:
issue731: Fixed problems caused by unbalanced braces in object representation strings (
repr) when collapsing explanations in test failure reports.issue553: Improved error handling for
inspect.getsourcelinesfailures withinFixtureLookupError, preventing internal errors that obscured the real problem.issue660: Enhanced reporting for scope-mismatch-access errors in fixtures, making them independent of fixture argument ordering and avoiding unhelpful internal tracebacks.
Streamlined the release process and centralized version information in
_pytest/__init__.py.Documentation updated to confirm that yield-fixtures are stable and no longer experimental.
Added support for building Python wheels with environment markers for requirements.
Regressed fixes from version 2.6.4 related to lost stdout capture upon
SystemExitexceptions.Reintroduced the
_pytestfixture in thepytesterplugin, which is important for other plugins likepytest-xdist.
Contributors
Key contributors acknowledged for this release:
Bruno Oliveira
Holger Krekel
Ionel Maries Cristian
Floris Bruynooghe
Carl Meyer (issue reporter)
talljosh (initial patch for issue553)
Implementation Details & Algorithms
As a release notes file, there are no direct algorithms or implementation code here. However, the notes reference important internal improvements:
Error Handling Enhancements: Changes to how errors like
FixtureLookupErrorand scope mismatches are reported to improve user experience by avoiding confusing internal tracebacks.Source Line Retrieval: Robust handling of
inspect.getsourcelinesfailures to prevent masking of errors.Version Management: Centralizing version information in
_pytest/__init__.pyto streamline release and documentation generation.Wheel Build Support: Use of environment markers to enable more flexible packaging with wheels.
These improvements reflect ongoing maintenance and usability enhancements in the pytest codebase.
Interactions with Other System Components
pytest Plugins: The reintroduction of the
_pytestfixture in thepytesterplugin benefits other plugins such aspytest-xdist, indicating inter-plugin dependencies.Setup and Documentation: The release process and versioning changes affect
setup.pyand documentation generation workflows.Testing Infrastructure: The fixes on error reporting and stdout capture influence pytest’s own internal test execution and reporting mechanisms.
Packaging System: Wheel build support ties into Python's packaging ecosystem and affects how pytest is distributed and installed.
This file is a part of the broader pytest project and primarily interacts by informing users and developers about the state and improvements of the codebase.
Usage Example
Since this is a changelog file, it is not imported or called directly within code. Its usage is for reference:
Before upgrading pytest, users and CI maintainers should review this file to understand the impact of the new version.
Plugin authors can check for any changes affecting plugin compatibility.
Developers can refer to the listed issues to explore patches or regressions fixed.
Visual Diagram
The following Mermaid class diagram illustrates the conceptual structure and key components referenced in the release notes related to pytest 2.7.1. Since the file itself contains no classes or functions, the diagram focuses on the main pytest components and plugins mentioned for context:
classDiagram
class Pytest {
+run_tests()
+collect_fixtures()
+report_errors()
}
class FixtureLookupError {
+__init__()
+handle_source_line_failure()
}
class PytesterPlugin {
+_pytest_fixture()
}
class PytestXdistPlugin {
+parallel_test_execution()
}
PytesterPlugin --> Pytest
PytestXdistPlugin --> PytesterPlugin : depends on
Pytest --> FixtureLookupError : raises
Pytest: Core testing framework managing test execution, fixture collection, and error reporting.
FixtureLookupError: Exception class enhanced to better handle source line retrieval failures.
PytesterPlugin: Plugin providing the
_pytestfixture, reintroduced in this release.PytestXdistPlugin: Plugin for parallel test execution relying on
pytester.
This diagram contextualizes the interactions and enhancements referenced in the release notes.
**Summary:** `release-2.7.1.rst` is the official changelog document for pytest version 2.7.1, detailing bug fixes, improvements, contributor acknowledgments, and upgrade instructions. It supports users and developers in understanding the changes made and ensures smooth transition from the prior pytest 2.7.0 release. While not containing executable code, it is a critical resource in the pytest project’s documentation ecosystem.