FailExtract Documentationο
FailExtract is a lightweight Python library for extracting and analyzing pytest test failures. It provides automatic failure context capture with minimal overhead and supports multiple output formats for different workflows.
Core Philosophy: Progressive enhancement with honest documentation. Start simple, grow sophisticated as needed.
Key Featuresο
Zero Dependencies: Core functionality uses only Python standard library
Automatic Context Capture: Local variables, stack traces, and pytest fixtures
Multiple Output Formats: JSON, Markdown, XML, CSV (built-in) + YAML (optional)
Performance Awareness: <5% overhead in production, configurable for different environments
pytest Integration: Seamless integration with existing test suites
Memory Management: Built-in limits and monitoring for long-running test suites
Quick Startο
Installation (30 seconds):
pip install failextract
First Use (2 minutes):
from failextract import extract_on_failure, FailureExtractor, OutputConfig
@extract_on_failure
def test_example():
user_data = {"name": "John", "age": 25}
assert user_data["name"] == "Jane", "Name mismatch"
# Run test (it will fail and be captured)
try:
test_example()
except AssertionError:
pass
# Generate report
extractor = FailureExtractor()
config = OutputConfig("failures.json")
extractor.save_report(config)
What just happened? FailExtract captured the failure context (local variables, exception details) and saved it as a JSON report. The user_data dictionary is now available for debugging.
Documentation Structureο
This documentation follows the DiΓ‘taxis framework for optimal learning and reference:
π Tutorials
π οΈ How-To Guides
- How-To Guides
- How to Install FailExtract
- How to Generate Reports
- How to Optimize Performance
- How to Troubleshoot Issues
- How to Set Up CI/CD for Documentation
- How to Set Up Automated PyPI Releases
- Quick Reference
- Task-Oriented Solutions
- How to Use These Guides
- When to Use How-To Guides vs. Tutorials
- Quick Solutions
- Get Started
π Discussions
- Discussions
- Architectural Philosophy: Building for Real-World Use
- Progressive Enhancement: From Simple to Sophisticated
- Performance Trade-offs: When More Information Costs More Time
- Development Journey: From Empty Module to Production Tool
- Documentation Philosophy: From Aspirational to Honest
- Testing Strategy: Architecture, Organization, and Quality Assurance
- Feature Scope Management: Strategic Simplicity Over Feature Completeness
- Design Patterns in FailExtract
- Extension Points in FailExtract
- Performance and Threading in FailExtract
- Overview of Discussion Topics
Getting Startedο
New to FailExtract?
Install: How to Install FailExtract (2 minutes)
Learn: Getting Started with FailExtract (5 minutes)
Explore: Working with Multiple Output Formats (10 minutes)
Have a specific problem?
Installation issues: How to Troubleshoot Issues
Need reports: How to Generate Reports
Performance concerns: How to Optimize Performance
Want to understand the design?
Why FailExtract exists: Architectural Philosophy: Building for Real-World Use
How it evolved: Development Journey: From Empty Module to Production Tool
Design principles: Progressive Enhancement: From Simple to Sophisticated
Need technical details?
Complete API: API Reference
All configuration options: Reference Documentation
Why FailExtract?ο
The Problem: Test failures often lack sufficient context for efficient debugging. Stack traces show what failed, but not the state that led to the failure.
The Solution: FailExtract automatically captures comprehensive failure context - local variables, fixture values, and execution environment - with minimal performance impact.
The Result: Faster debugging, better failure analysis, and improved test reliability through actionable failure reports.
Design Philosophy:
Progressive Enhancement - Start simple, add complexity only when needed
Honest Documentation - Document what actually works, not what we wish worked
Performance Awareness - Explicit trade-offs between detail and speed
Zero Dependencies - Core functionality works everywhere Python runs
Production Readyο
FailExtract is designed for real-world usage:
Community and Supportο
Get Help
Documentation: Youβre reading it! Start with Getting Started with FailExtract
Troubleshooting: How to Troubleshoot Issues for common problems
GitHub Issues: Report bugs and request features
Examples: Working examples in the
examples/directory
Project Links
PyPI Package: https://pypi.org/project/failextract/
GitHub Repository: https://github.com/your-org/failextract
Issue Tracker: https://github.com/your-org/failextract/issues
Contributing
Contributions welcome! See Development Journey: From Empty Module to Production Tool for the development philosophy and approach.