Sourced from pytest's releases.
7.0.0
pytest 7.0.0 (2022-02-03)
(Please see the full set of changes for this release also in the 7.0.0rc1 notes below)
Deprecations
#9488: If custom subclasses of nodes like
pytest.Item
{.interpreted-text role="class"} override the__init__
method, they should take**kwargs
. Seeuncooperative-constructors-deprecated
{.interpreted-text role="ref"} for details.Note that a deprection warning is only emitted when there is a conflict in the arguments pytest expected to pass. This deprecation was already part of pytest 7.0.0rc1 but wasn't documented.
Bug Fixes
- #9355: Fixed error message prints function decorators when using assert in Python 3.8 and above.
- #9396: Ensure
pytest.Config.inifile
{.interpreted-text role="attr"} is available during thepytest_cmdline_main <_pytest.hookspec.pytest_cmdline_main>
{.interpreted-text role="func"} hook (regression during7.0.0rc1
).Improved Documentation
- #9404: Added extra documentation on alternatives to common misuses of [pytest.warns(None)]{.title-ref} ahead of its deprecation.
- #9505: Clarify where the configuration files are located. To avoid confusions documentation mentions that configuration file is located in the root of the repository.
Trivial/Internal Changes
- #9521: Add test coverage to assertion rewrite path.
pytest 7.0.0rc1 (2021-12-06)
Breaking Changes
#7259: The
Node.reportinfo() <non-python tests>
{.interpreted-text role="ref"} function first return value type has been expanded from [py.path.local | str]{.title-ref} to [os.PathLike[str] | str]{.title-ref}.Most plugins which refer to [reportinfo()]{.title-ref} only define it as part of a custom
pytest.Item
{.interpreted-text role="class"} implementation. Since [py.path.local]{.title-ref} is a [os.PathLike[str]]{.title-ref}, these plugins are unaffacted.Plugins and users which call [reportinfo()]{.title-ref}, use the first return value and interact with it as a [py.path.local]{.title-ref}, would need to adjust by calling [py.path.local(fspath)]{.title-ref}. Although preferably, avoid the legacy [py.path.local]{.title-ref} and use [pathlib.Path]{.title-ref}, or use [item.location]{.title-ref} or [item.path]{.title-ref}, instead.
Note: pytest was not able to provide a deprecation period for this change.
... (truncated)
3554b83
Add note to changelog6ea7f99
Prepare release version 7.0.0737b220
[7.0.x] releasing: Add template for major releases (#9597)7fa3972
[7.0.x] releasing: Always set doc_version (#9590)b304499
[7.0.x] Make 'warnings' and 'deselected' in assert_outcomes optional (#9566)f17525d
[7.0.x] doc: Add ellipsis to warning usecase list (#9562)0a7be97
ci: Bump up timeout (#9565)c17908c
[7.0.x] doc: Recategorize 7.0.0 changelog items (#9564)ab549bb
[7.0.x] Add missing cooperative constructor changelog (#9563)4b1707f
[7.0.x] Autouse linearization graph (#9557)