# pytest.fail() called without a message; use pytest.fail(reason='...')

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

## Root Cause

Calling pytest.fail() without a reason argument is deprecated or raises an error in newer pytest versions to enforce descriptive failure messages.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.10 | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   Always provide a reason: pytest.fail(reason='Expected condition not met')
   ```
2. **** (90% success)
   ```
   Use pytest.fail('message') as a positional argument, which is equivalent to pytest.fail(reason='message').
   ```

## Dead Ends

- **** — Using a bare raise or assert False may work but loses the structured failure reporting of pytest. (50% fail)
- **** — Ignoring the warning and continuing to use pytest.fail() without argument may cause test failures in future pytest versions. (60% fail)
