# AttributeError: 'FixtureRequest' object has no attribute 'param'

- **ID:** `python/pytest-fixture-request-param-error`
- **Domain:** python
- **Category:** attribute_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

在非参数化夹具中尝试访问 request.param，但该属性仅存在于参数化夹具中。

## Version Compatibility

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

## Workarounds

1. **** (100% success)
   ```
   将夹具标记为 `@pytest.fixture(params=[...])` 才能访问 request.param。
   ```
2. **** (80% success)
   ```
   通过 `request.getfixturevalue('fixture_name')` 获取夹具值，而非访问 param。
   ```

## Dead Ends

- **** — 可能不必要，且改变测试结构。 (50% fail)
- **** — 掩盖了设计问题，且属性不存在时应处理。 (40% fail)
