# 断言错误：断言 True == False（此模块的 pytest 断言重写已禁用）

- **ID:** `python/pytest-assertion-rewriting-disabled`
- **领域:** python
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

测试模块未被 pytest 的断言重写处理，通常是因为它位于带有 __init__.py 的目录中或不在测试文件中。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.x | active | — | — |

## 解决方案

1. **** (95% 成功率)
   ```
   Move test file to a directory without __init__.py and name it test_*.py
   ```
2. **** (90% 成功率)
   ```
   Create an empty conftest.py in the test directory.
   ```

## 无效尝试

- **** — This actually can disable assertion rewriting; removing it is better. (80% 失败率)
- **** — The assertion still fails, but the message is less informative. (60% 失败率)
