# 类型错误：'function'对象不可调用

- **ID:** `python/pytest-capture-using-fixture-as-function`
- **领域:** python
- **类别:** type_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

pytest测试中，fixture名称被错误地当作函数调用，导致TypeError。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.7 | active | — | — |

## 解决方案

1. **** (95% 成功率)
   ```
   def test_example(my_fixture):
    assert my_fixture == expected
   ```
2. **** (90% 成功率)
   ```
   确保没有定义与fixture同名的函数，例如：def my_fixture(): pass 会覆盖fixture
   ```

## 无效尝试

- **** — 删除fixture会导致其他测试无法使用，且根本原因未解决。 (80% 失败率)
- **** — lambda不会改变fixture的本质，调用仍会失败。 (90% 失败率)
