release-2.8.3.rst
Overview
This file is the release notes documentation for **pytest version 2.8.3**, a mature Python testing framework. It summarizes the key bug fixes, enhancements, and contributions included in this patch release, which is intended to be fully compatible with the previous version 2.8.2. The document serves as an important reference for users upgrading pytest, highlighting critical fixes and improvements that affect test collection, reporting, and usability.
The primary goal of this file is to inform developers and users about changes that may impact their testing workflows, ensuring smooth transitions between versions without unexpected disruptions.
Details of Contents
Release Title and Introduction
pytest-2.8.3: bug fixes
Introduces the release name and emphasizes the focus on bug fixes.Description
Briefly describes pytest as a mature testing tool with extensive test coverage across platforms.Compatibility
States that this release is drop-in compatible with version 2.8.2.Documentation URL
Provides the URL for official pytest documentation: http://pytest.orgUpgrade Instructions
Command to upgrade pytest via pip:pip install -U pytestAcknowledgements
Credits contributors who submitted patches, bug reports, or improvements.
Change Log (2.8.3 compared to 2.8.2)
The change log is a bullet list describing bug fixes and enhancements:
Fix #1169:
Added__name__attribute to test cases inTestCaseFunctionto support the@unittest.skipdecorator on functions and methods.
Contributor: Lee KamentskyFix #1035:
Improved test collection when the test module-level object has a__getattr__()method.
Contributors: Suor (report), Bruno Oliveira, Tom Viner (PR)Fix #331:
Prevented collection of tests whose failures cannot be reported correctly, such as callable instances of classes.Fix #1133:
Resolved an internal error in traceback filtering when an entry belongs to a file that no longer exists.
Contributor: Bruno OliveiraEnhancement:
Test failure output now highlights failing test names in red to improve visibility.
Contributor: Gabriel ReisDocumentation updates:
Added more talks to documentation.
Extended documentation on the
--ignoreCLI option.
Build system update:
Integratedpytest-runnerfor setuptools integration.Compatibility fix:
Minor fixes for OS X El Capitan system integrity protection issues.
Contributor: Florian
Important Implementation Details
TestCaseFunction
__name__attribute fix
The addition of the__name__attribute to test cases enables compatibility with the@unittest.skipdecorator, which relies on the presence of this attribute to identify tests to skip. This fix improves interoperability between pytest and unittest-based decorators.Test collection improvement for
__getattr__
Modules implementing__getattr__can dynamically provide attributes, which previously interfered with pytest's test discovery. This fix allows pytest to correctly handle such dynamic attributes during test collection.Traceback filtering robustness
When filtering tracebacks, pytest may encounter files that no longer exist (e.g., deleted or moved during runtime). The fix prevents internal errors by safely handling missing files in traceback entries.Enhanced output readability
Highlighting failing test names in red helps users quickly locate failed tests in the console output, improving user experience during test runs.
Interaction with Other System Components
Test discovery and collection subsystem:
Changes affecting test collection (fixes #1035, #331) interact deeply with pytest’s core discovery mechanism. These ensure that all valid tests are collected without errors or false positives.Test execution and reporting:
The traceback filtering fix (#1133) and failure highlighting affect the reporting layer, which formats and displays test results to the user.Integration with standard unittest framework:
The fix to support@unittest.skipdecorator indicates interaction with Python’s built-in unittest module, ensuring pytest can interoperate with unittest features and decorators.Build and packaging:
The addition ofpytest-runnerenhances setuptools integration for packaging and distribution.Platform compatibility:
Minor fixes for OS X El Capitan’s System Integrity Protection improve pytest’s ability to run reliably on macOS environments with enhanced security.
Usage Examples
Since this file is a changelog, direct usage examples are not applicable. However, users upgrading to pytest 2.8.3 can expect:
Smooth test runs with improved compatibility for unittest decorators.
Better handling of dynamically generated test attributes.
More robust error reporting and clearer failure output.
Enhanced documentation and build integration.
Mermaid Class Diagram
This file is a changelog and contains no classes or functions. Therefore, a class diagram is not applicable here.
Instead, a flowchart illustrating the relationship between the major changes and pytest subsystems impacted is provided below:
flowchart TD
A[pytest 2.8.3 Release] --> B[Test Collection]
A --> C[Test Execution & Reporting]
A --> D[Build & Packaging]
A --> E[Documentation]
A --> F[Platform Compatibility]
B --> B1[Fix __getattr__ test collection (#1035)]
B --> B2[Skip callable instances (#331)]
B --> B3[Add __name__ to TestCaseFunction (#1169)]
C --> C1[Traceback filtering fix (#1133)]
C --> C2[Highlight failing test names]
D --> D1[Add pytest-runner for setuptools]
E --> E1[Add talks & extend --ignore docs]
F --> F1[Fix OS X El Capitan SIP issues]
This diagram summarizes how the release impacts different components of the pytest system.
**Summary**: The [release-2.8.3.rst](/projects/286/66986) file documents incremental improvements and important bug fixes in pytest version 2.8.3, focusing on test collection robustness, better unittest integration, improved error reporting, and platform compatibility. It guides users through the changes with clear descriptions and acknowledges community contributions, ensuring transparency and ease of adoption for this patch release.