# Failed: Warnings summary
...
PytestUnraisableExceptionWarning: Exception ignored in: <function ...>

- **ID:** `python/pytest-warnings-summary-failed`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

An unraisable exception occurred during garbage collection, often due to a file or socket not being closed properly. pytest treats this as a failure when -W error is set or when the warning is configured as error.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 7.x | active | — | — |
| 8.x | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   Use context managers or explicit close in teardown:
@pytest.fixture
def resource():
    r = open('file')
    yield r
    r.close()
   ```
2. **** (80% success)
   ```
   In pytest.ini:
[pytest]
filterwarnings =
    ignore::pytest.PytestUnraisableExceptionWarning
   ```

## Dead Ends

- **** — This hides the symptom but the resource leak remains, potentially causing other issues. (70% fail)
- **** — Forcing collection may trigger the warning earlier but does not fix the leak. (80% fail)
