# AssertionError: assert False
 +  where False = <function is_valid at 0x...>(123)

- **ID:** `python/pytest-assertion-rewrite-disabled`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Assertion rewriting was disabled (via --assert=plain, PYTHONDONTWRITEBYTECODE, or a plugin conflict), so pytest cannot introspect the sub-expression that produced False and prints only the raw assert.

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   # pytest.ini
[pytest]
addopts = --assert=rewrite
# ensure no PYTHONDONTWRITEBYTECODE=1 in env
   ```
2. **** (85% success)
   ```
   # conftest.py
import pytest
pytest.register_assert_rewrite('tests.test_api')
   ```

## Dead Ends

- **** — -s disables output capture, not assertion rewriting; the introspection message remains absent. (80% fail)
- **** — This defeats the purpose of pytest's introspection and pollutes test output with manual prints. (60% fail)
