# 预期：
    {'id': 1, 'name': 'Alice', 'created': '2024-01-01T00:00:00'}
实际：
    {'id': 1, 'name': 'Alice', 'created': '2024-01-01T00:00:00.123456'}

- **ID:** `python/pytest-doctest-ellipsis-mismatch`
- **领域:** python
- **类别:** runtime_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

Doctest 默认比较输出的精确 repr。非确定性值（时间戳、UUID、内存地址、浮点数）在运行之间不同，因此 doctest 会间歇性失败。

## 版本兼容性

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

## 解决方案

1. **** (95% 成功率)
   ```
   >>> get_user(1)  # doctest: +ELLIPSIS
{'id': 1, 'name': 'Alice', 'created': '...'}
   ```
2. **** (92% 成功率)
   ```
   # In conftest.py or pytest.ini:
# doctest_optionflags = ELLIPSIS NORMALIZE_WHITESPACE

>>> get_user(1)  # doctest: +ELLIPSIS
{'id': 1, 'name': 'Alice', 'created': '...'}
   ```

## 无效尝试

- **** — Skips the whole example, including the parts that are deterministic and worth testing. (80% 失败率)
- **** — Doctest does not support regex natively; you'd need a custom OutputChecker, which is heavy for one example. (75% 失败率)
