# PytestReturnNotNoneWarning: Expected None, but tests/test_x.py::test_foo returned 1, which will be an error in a future version of pytest

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

## Root Cause

A test function returns a value instead of using assert. Common when porting unittest-style tests or when a helper returns a truthy value that was intended as an assertion.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 7.x | active | — | — |
| 8.x | active | — | — |

## Workarounds

1. **** (98% success)
   ```
   # before
def test_foo():
    return compute() == 1

# after
def test_foo():
    assert compute() == 1
   ```
2. **** (90% success)
   ```
   [tool.pytest.ini_options]
filterwarnings = ["error::pytest.PytestReturnNotNoneWarning"]
   ```

## Dead Ends

- **** — Silences the warning but the test may pass even when the intended condition is false, because no assertion occurs. (70% fail)
- **** — Hides a real bug: the test is not actually asserting anything. (85% fail)
