pytest 8.0.0rc2 (2024-01-17)
Improvements
- #11233: Improvements to
-r
for xfailures and xpasses:- Report tracebacks for xfailures when
-rx
is set. - Report captured output for xpasses when
-rX
is set. - For xpasses, add
-
in summary between test name and reason, to match how xfail is displayed.
- Report tracebacks for xfailures when
- #11825: The
pytest_plugin_registered
{.interpreted-text role="hook"} hook has a newplugin_name
parameter containing the name by whichplugin
is registered.
Bug Fixes
-
#11706: Fix reporting of teardown errors in higher-scoped fixtures when using [--maxfail]{.title-ref} or [--stepwise]{.title-ref}.
-
#11758: Fixed
IndexError: string index out of range
crash inif highlighted[-1] == "\n" and source[-1] != "\n"
.
This bug was introduced in pytest 8.0.0rc1. -
#9765, #11816: Fixed a frustrating bug that afflicted some users with the only error being
assert mod not in mods
. The issue was caused by the fact thatstr(Path(mod))
andmod.__file__
don't necessarily produce the same string, and was being erroneously used interchangably in some places in the code.This fix also broke the internal API of
PytestPluginManager.consider_conftest
by introducing a new parameter -- we mention this in case it is being used by external code, even if marked as private.