Overview
pytest 8.4, released on June 2, 2025, adds a terminal progress indicator and now fails tests that return a non-None value.
Main Features
Terminal progress
A progress indicator is displayed during test execution, showing real-time completion percentage.
python
# pytest now shows progress:
# tests/test_app.py [25%]
# tests/test_utils.py [50%]
# tests/test_api.py [100%]
def test_addition():
assert 2 + 2 == 4
def test_string():
assert 'hello'.upper() == 'HELLO'
Non-None return failure
Test functions returning a non-None value now trigger a failure. This catches accidental return instead of assert.
python
# FAIL: returns True instead of assert
def test_wrong():
return 2 + 2 == 4 # pytest 8.4 fails here
# CORRECT: use assert
def test_correct():
assert 2 + 2 == 4 # OK
