# Failed: FAILED test_function - AssertionError: custom message

- **ID:** `python/pytest-fail-exception`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

使用pytest.fail()或断言失败时，pytest抛出Failed异常，测试停止。

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   pytest.fail("原因: " + str(detail))
   ```
2. **** (80% success)
   ```
   if not condition:
    pytest.skip('跳过原因')
   ```

## Dead Ends

- **** — Failed是pytest内部异常，捕获后测试仍会失败 (70% fail)
- **** — assert信息不如pytest.fail清晰 (50% fail)
