# Fixture 'data' called directly. Fixtures are not meant to be called directly, but are provided automatically by pytest.

- **ID:** `python/pytest-fixture-return-none`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A test or fixture tries to call a fixture function directly (e.g., data()) instead of using it as a parameter, causing pytest to raise an error because fixtures are not regular functions.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   Use the fixture as a parameter in the test function: def test_foo(data): instead of calling data().
   ```
2. **** (80% success)
   ```
   If you need to call a fixture programmatically, use the request fixture: request.getfixturevalue('data')
   ```

## Dead Ends

- **** — Adding a return value to the fixture does not fix the issue because the fixture is still being called incorrectly. (70% fail)
- **** — Converting the fixture to a regular function may work but loses the benefits of fixture scoping and dependency injection. (50% fail)
