#1367:Support for subtests has been added.
subtests <subtests> are an alternative to parametrization, useful in situations where the parametrization values are not all known at collection time.
Example:
defcontains_docstring(p:Path)->bool:"""Return True if the given Python file contains a top-level docstring.""" ...deftest_py_files_contain_docstring(subtests:pytest.Subtests)->None:forpathinPath.cwd().glob("*.py"):withsubtests.test(path=str(path)):assertcontains_docstring(path)Each assert failure or error is caught by the context manager and reported individually, giving a clear picture of all files that are missing a docstring.
In addition,unittest.TestCase.subTest is now also supported.
This feature was originally implemented as a separate plugin inpytest-subtests, but since then has been merged into the core.
[!NOTE]
This feature is experimental and will likely evolve in future releases. By that we mean that we might change how subtests are reported on failure, but the functionality and how to use it are stable.
#13743: Added support fornative TOML configuration files.
While pytest, since version 6, supports configuration inpyproject.toml files under[tool.pytest.ini_options],
it does so in an "INI compatibility mode", where all configuration values are treated as strings or list of strings.
Now, pytest supports the native TOML data model.
Inpyproject.toml, the native TOML configuration is under the[tool.pytest] table.
# pyproject.toml[tool.pytest]minversion ="9.0"addopts = ["-ra","-q"]testpaths = ["tests","integration",]
The[tool.pytest.ini_options] table remains supported, but both tables cannot be used at the same time.
If you prefer to use a separate configuration file, or don't usepyproject.toml, you can usepytest.toml or.pytest.toml:
# pytest.toml or .pytest.toml[pytest]minversion ="9.0"addopts = ["-ra","-q"]testpaths = ["tests","integration",]
The documentation now (sometimes) shows configuration snippets in both TOML and INI formats, in a tabbed interface.
Seeconfig file formats for full details.
#13823: Added a"strict mode" enabled by thestrict configuration option.
When set totrue, thestrict option currently enables
strict_configstrict_markersstrict_parametrization_idsstrict_xfail
The individual strictness options can be explicitly set to override the globalstrict setting.
The previously-deprecated--strict command-line flag now enables strict mode.
If pytest adds new strictness options in the future, they will also be enabled in strict mode.
Therefore, you should only enable strict mode if you use a pinned/locked version of pytest,
or if you want to proactively adopt new strictness options as they are added.
Seestrict mode for more details.
#13737: Added thestrict_parametrization_ids configuration option.
When set, pytest emits an error if it detects non-unique parameter set IDs,
rather than automatically making the IDs unique by adding0,1, ... to them.
This can be particularly useful for catching unintended duplicates.
#13072: Added support for displaying test sessionprogress in the terminal tab using theOSC 9;4; ANSI sequence.
When pytest runs in a supported terminal emulator like ConEmu, Gnome Terminal, Ptyxis, Windows Terminal, Kitty or Ghostty,
you'll see the progress in the terminal tab or window,
allowing you to monitor pytest's progress at a glance.
This feature is automatically enabled when running in a TTY. It is implemented as an internal plugin. If needed, it can be disabled as follows:
- On a user level, using
-p no:terminalprogress on the command line or via an environment variablePYTEST_ADDOPTS='-p no:terminalprogress'. - On a project configuration level, using
addopts = "-p no:terminalprogress".
#478: Support PEP420 (implicit namespace packages) as--pyargs target whenconsider_namespace_packages istrue in the config.
Previously, this option only impacted package imports, now it also impacts tests discovery.
#13678: Added a newfaulthandler_exit_on_timeout configuration option set to "false" by default to letfaulthandler interrupt thepytest process after a timeout in case of deadlock.
Previously, afaulthandler timeout would only dump the traceback of all threads to stderr, but would not interrupt thepytest process.
-- byogrisel.
#13829: Added support for configuration option aliases via thealiases parameter inParser.addini() <pytest.Parser.addini>.
Plugins can now register alternative names for configuration options,
allowing for more flexibility in configuration naming and supporting backward compatibility when renaming options.
The canonical name always takes precedence if both the canonical name and an alias are specified in the configuration file.
#13330: Having pytest configuration spread over more than one file (for example having both apytest.ini file andpyproject.toml with a[tool.pytest.ini_options] table) will now print a warning to make it clearer to the user that only one of them is actually used.
-- bysgaist
#13574: The single argument--version no longer loads the entire plugin infrastructure, making it faster and more reliable when displaying only the pytest version.
Passing--version twice (e.g.,pytest --version --version) retains the original behavior, showing both the pytest version and plugin information.
[!NOTE]
Since--version is now processed early, it only takes effect when passed directly via the command line. It will not work if set through other mechanisms, such asPYTEST_ADDOPTS oraddopts.
#13823: Addedstrict_xfail as an alias to thexfail_strict option,
strict_config as an alias to the--strict-config flag,
andstrict_markers as an alias to the--strict-markers flag.
This makes all strictness options consistently have configuration options with the prefixstrict_.
#13700:--junitxml no longer prints thegenerated xml file summary at the end of the pytest session when--quiet is given.
#13732: Previously, when filtering warnings, pytest would fail if the filter referenced a class that could not be imported. Now, this only outputs a message indicating the problem.
#13859: Clarify the error message forpytest.raises() when a regexmatch fails.
#13861: Better sentence structure in a test's expected error message. Previously, the error message would be "expected exception must be <expected>, but got <actual>". Now, it is "Expected <expected>, but got <actual>".
#12083: Fixed a bug where an invocation such aspytest a/ a/b would cause only tests froma/b to run, and not other tests undera/.
The fix entails a few breaking changes to how such overlapping arguments and duplicates are handled:
- pytest a/b a/ orpytest a/ a/b are equivalent topytest a; if an argument overlaps another arguments, only the prefix remains.
- pytest x.py x.py is equivalent topytest x.py; previously such an invocation was taken as an explicit request to run the tests from the file twice.
If you rely on these behaviors, consider using--keep-duplicates <duplicate-paths>, which retains its existing behavior (including the bug).
#13719: Support for Python 3.9 is dropped following its end of life.
#13766: Previously, pytest would assume it was running in a CI/CD environment if either of the environment variables$CI or$BUILD_NUMBER was defined;
now, CI mode is only activated if at least one of those variables is defined and set to anon-empty value.
#13779:PytestRemovedIn9Warning deprecation warnings are now errors by default.
Following our plan to remove deprecated features with as little disruption as
possible, all warnings of typePytestRemovedIn9Warning now generate errors
instead of warning messages by default.
The affected features will be effectively removed in pytest 9.1, so please consult the
deprecations section in the docs for directions on how to update existing code.
In the pytest9.0.X series, it is possible to change the errors back into warnings as a
stopgap measure by adding this to yourpytest.ini file:
[pytest]filterwarnings = ignore::pytest.PytestRemovedIn9Warning
But this will stop working when pytest9.1 is released.
If you have concerns about the removal of a specific feature, please add a
comment to13779.
This PR contains the following updates:
==2.41.1->==2.45.0==1.5.1->==1.40.0==3.1.0->==3.7.0==8.4.2->==9.0.2==1.1.1->==1.2.1==2.32.4->==2.32.5Release Notes
googleapis/google-auth-library-python (google-auth)
v2.45.0Compare Source
Features
v2.44.0Compare Source
Features
Bug Fixes
v2.43.0Compare Source
Features
GOOGLE_API_USE_CLIENT_CERTIFICATE is not set, when the MWID/X.509 cert
sources detected. Also, fix check_use_client_cert to return boolean
value.
Change#1848 added the check_use_client_cert method that helps know if
client cert should be used for mTLS connection. However, that was in a
private class, thus, created a public wrapper of the same function so
that it can be used by python Client Libraries. Also, updated
check_use_client_cert to return a boolean value instead of existing
string value for better readability and future scope.
--------- (1535eccbff0ad8f3fd6a9775316ac8b77dca66ba)
(either true or false), the SDK will respect that setting. This is
necessary for test scenarios and users who need to explicitly control
mTLS behavior.
set, the SDK will automatically enable mTLS only if it detects Managed
Workload Identity (MWID) or X.509 Workforce Identity Federation (WIF)
certificate sources. In other cases where the variable is not set, mTLS
will remain disabled.
** This change also adds the helper method
check_use_client_certandit's unit test, which will be used for checking the criteria for setting
the mTLS to true
** This change is only for Auth-Library, other changes will be created
for Client-Library use-cases.
--------- (395e405b64b56ddb82ee639958c2e8056ad2e82b)
google-authto librarian (#1838) This PR onboardsgoogle-authlibrary to the Librarian system.Wait for
#1819. (c503eaa511357d7a76cc1e1f1d3a3be2dabd5bca)
v2.42.1Compare Source
Bug Fixes
v2.42.0Compare Source
Features
Bug Fixes
googleapis/google-cloud-python (google-cloud-compute)
v1.40.0: google-cloud-compute 1.40.0Compare Source
Features
2025091(#1107) (4dc7381c)v1.39.0: google-cloud-compute 1.39.0Compare Source
Features
[google-cloud-compute] Update Compute Engine v1 API to revision
2025090(4e5a0b5)[google-cloud-compute] Update Compute Engine v1 API to revision
2025090(4e5a0b5)v1.38.0: google-cloud-compute: v1.38.0Compare Source
Features
2025090(#14434) (daf5ab8)v1.37.0: google-cloud-compute: v1.37.0Compare Source
Features
2025081(#1091) (#14324) (6cdbcee)v1.36.0: google-cloud-compute: v1.36.0Compare Source
Features
2025080(51732d3)v1.35.0: google-cloud-compute: v1.35.0Compare Source
Features
2025072(#1081) (#14196) (9abaf2f)2025072(#1085) (#14199) (17c935f)v1.34.0: google-cloud-compute: v1.34.0Compare Source
Features
2025071(#1074) (#14169) (0c26f13)v1.33.0: google-cloud-compute: v1.33.0Compare Source
Features
2025070(#1073) (#14107) (723ac5d)v1.32.0: google-cloud-compute: v1.32.0Compare Source
Features
2025062(3ad8819)v1.31.0: google-cloud-compute: v1.31.0Compare Source
Features
2025060(#13970) (8083640)2025051(#1047) (8083640)v1.30.0: google-cloud-compute: v1.30.0Compare Source
Features
2025041(#13800) (ae6a7c9)v1.29.0: google-cloud-compute: v1.29.0Compare Source
Features
2025032(#13710) (da0e811)v1.28.0: google-cloud-compute: v1.28.0Compare Source
Features
2025030(#13678) (9be352b)v1.27.0Compare Source
v1.26.0Compare Source
v1.25.0Compare Source
v1.24.0Compare Source
v1.23.0Compare Source
v1.22.0Compare Source
v1.21.0: google-cloud-os-config: v1.21.0Compare Source
Features
Documentation
filterin message.google.cloud.osconfig.v1.ListVulnerabilityReportsRequestis changed (e8feca7)update_timein message.google.cloud.osconfig.v1.VulnerabilityReportis changed (e8feca7)v1.20.1Compare Source
v1.20.0Compare Source
v1.19.2Compare Source
v1.19.1Compare Source
v1.19.0Compare Source
v1.18.0Compare Source
v1.17.0: google-cloud-trace 1.17.0Compare Source
1.17.0 (2025-10-20)
v1.16.1Compare Source
v1.16.0Compare Source
v1.15.0: google-cloud-resource-manager 1.15.0Compare Source
1.15.0 (2025-10-20)
v1.14.1v1.14.0v1.13.0v1.12.1v1.12.0v1.11.0v1.10.0v1.9.0v1.7.0: google-cloud-appengine-logging 1.7.01.7.0 (2025-10-16)
v1.6.1v1.6.0googleapis/python-storage (google-cloud-storage)
v3.7.0Compare Source
Features
Bug Fixes
v3.6.0Compare Source
Features
Bug Fixes
v3.5.0Compare Source
Features
Bug Fixes
download_rangescompatible withasyncio.create_task(..)(#1591) (faf8b83)download_rangescompatible withasyncio.create_task(..)(#1591) (faf8b83)v3.4.1Compare Source
Bug Fixes
upload_from_string,upload_from_file, andupload_from_filenamemethods (acb918e)v3.4.0Compare Source
Features
Bug Fixes
v3.3.1Compare Source
Bug Fixes
v3.3.0Compare Source
Features
Bug Fixes
Documentation
v3.2.0Compare Source
Features
v3.1.1Compare Source
Bug Fixes
Documentation
pytest-dev/pytest (pytest)
v9.0.2Compare Source
pytest 9.0.2 (2025-12-06)
Bug fixes
#13896: The terminal progress feature added in pytest 9.0.0 has been disabled by default, except on Windows, due to compatibility issues with some terminal emulators.
You may enable it again by passing
-p terminalprogress. We may enable it by default again once compatibility improves in the future.Additionally, when the environment variable
TERMisdumb, the escape codes are no longer emitted, even if the plugin is enabled.#13904: Fixed the TOML type of the
tmp_path_retention_countsettings in the API reference from number to string.#13946: The private
config.inicfgattribute was changed in a breaking manner in pytest 9.0.0.Due to its usage in the ecosystem, it is now restored to working order using a compatibility shim.
It will be deprecated in pytest 9.1 and removed in pytest 10.
#13965: Fixed quadratic-time behavior when handling
unittestsubtests in Python 3.10.Improved documentation
pytest's command-line flags <command-line-flags>.v9.0.1Compare Source
pytest 9.0.1 (2025-11-12)
Bug fixes
raise unittest.SkipTest.Packaging updates and notes for downstreams
version string can be passed into its
package_envthroughthe
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTESTenvironmentvariable as a part of the release process -- by
webknjaz.Contributor-facing changes
creating GitHub Releases without having a Git checkout on
disk -- by
bluetechandwebknjaz.version string can be passed into its
package_envthroughthe
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTESTenvironmentvariable as a part of the release process -- by
webknjaz.v9.0.0Compare Source
pytest 9.0.0 (2025-11-05)
New features
#1367:Support for subtests has been added.
subtests <subtests>are an alternative to parametrization, useful in situations where the parametrization values are not all known at collection time.Example:
Each assert failure or error is caught by the context manager and reported individually, giving a clear picture of all files that are missing a docstring.
In addition,
unittest.TestCase.subTestis now also supported.This feature was originally implemented as a separate plugin inpytest-subtests, but since then has been merged into the core.
#13743: Added support fornative TOML configuration files.
While pytest, since version 6, supports configuration in
pyproject.tomlfiles under[tool.pytest.ini_options],it does so in an "INI compatibility mode", where all configuration values are treated as strings or list of strings.
Now, pytest supports the native TOML data model.
In
pyproject.toml, the native TOML configuration is under the[tool.pytest]table.The
[tool.pytest.ini_options]table remains supported, but both tables cannot be used at the same time.If you prefer to use a separate configuration file, or don't use
pyproject.toml, you can usepytest.tomlor.pytest.toml:The documentation now (sometimes) shows configuration snippets in both TOML and INI formats, in a tabbed interface.
See
config file formatsfor full details.#13823: Added a"strict mode" enabled by the
strictconfiguration option.When set to
true, thestrictoption currently enablesstrict_configstrict_markersstrict_parametrization_idsstrict_xfailThe individual strictness options can be explicitly set to override the global
strictsetting.The previously-deprecated
--strictcommand-line flag now enables strict mode.If pytest adds new strictness options in the future, they will also be enabled in strict mode.
Therefore, you should only enable strict mode if you use a pinned/locked version of pytest,
or if you want to proactively adopt new strictness options as they are added.
See
strict modefor more details.#13737: Added the
strict_parametrization_idsconfiguration option.When set, pytest emits an error if it detects non-unique parameter set IDs,
rather than automatically making the IDs unique by adding0,1, ... to them.
This can be particularly useful for catching unintended duplicates.
#13072: Added support for displaying test sessionprogress in the terminal tab using theOSC 9;4; ANSI sequence.
When pytest runs in a supported terminal emulator like ConEmu, Gnome Terminal, Ptyxis, Windows Terminal, Kitty or Ghostty,
you'll see the progress in the terminal tab or window,
allowing you to monitor pytest's progress at a glance.
This feature is automatically enabled when running in a TTY. It is implemented as an internal plugin. If needed, it can be disabled as follows:
-p no:terminalprogresson the command line or via an environment variablePYTEST_ADDOPTS='-p no:terminalprogress'.addopts = "-p no:terminalprogress".#478: Support PEP420 (implicit namespace packages) as--pyargs target when
consider_namespace_packagesistrue in the config.Previously, this option only impacted package imports, now it also impacts tests discovery.
#13678: Added a new
faulthandler_exit_on_timeoutconfiguration option set to "false" by default to letfaulthandler interrupt thepytest process after a timeout in case of deadlock.Previously, afaulthandler timeout would only dump the traceback of all threads to stderr, but would not interrupt thepytest process.
-- by
ogrisel.#13829: Added support for configuration option aliases via the
aliasesparameter inParser.addini() <pytest.Parser.addini>.Plugins can now register alternative names for configuration options,
allowing for more flexibility in configuration naming and supporting backward compatibility when renaming options.
The canonical name always takes precedence if both the canonical name and an alias are specified in the configuration file.
Improvements in existing functionality
#13330: Having pytest configuration spread over more than one file (for example having both a
pytest.inifile andpyproject.tomlwith a[tool.pytest.ini_options]table) will now print a warning to make it clearer to the user that only one of them is actually used.-- by
sgaist#13574: The single argument
--versionno longer loads the entire plugin infrastructure, making it faster and more reliable when displaying only the pytest version.Passing
--versiontwice (e.g.,pytest --version --version) retains the original behavior, showing both the pytest version and plugin information.#13823: Added
strict_xfailas an alias to thexfail_strictoption,strict_configas an alias to the--strict-configflag,and
strict_markersas an alias to the--strict-markersflag.This makes all strictness options consistently have configuration options with the prefix
strict_.#13700:--junitxml no longer prints thegenerated xml file summary at the end of the pytest session when--quiet is given.
#13732: Previously, when filtering warnings, pytest would fail if the filter referenced a class that could not be imported. Now, this only outputs a message indicating the problem.
#13859: Clarify the error message forpytest.raises() when a regexmatch fails.
#13861: Better sentence structure in a test's expected error message. Previously, the error message would be "expected exception must be <expected>, but got <actual>". Now, it is "Expected <expected>, but got <actual>".
Removals and backward incompatible breaking changes
#12083: Fixed a bug where an invocation such aspytest a/ a/b would cause only tests froma/b to run, and not other tests undera/.
The fix entails a few breaking changes to how such overlapping arguments and duplicates are handled:
If you rely on these behaviors, consider using
--keep-duplicates <duplicate-paths>, which retains its existing behavior (including the bug).#13719: Support for Python 3.9 is dropped following its end of life.
#13766: Previously, pytest would assume it was running in a CI/CD environment if either of the environment variables$CI or$BUILD_NUMBER was defined;
now, CI mode is only activated if at least one of those variables is defined and set to anon-empty value.
#13779:PytestRemovedIn9Warning deprecation warnings are now errors by default.
Following our plan to remove deprecated features with as little disruption as
possible, all warnings of type
PytestRemovedIn9Warningnow generate errorsinstead of warning messages by default.
The affected features will be effectively removed in pytest 9.1, so please consult the
deprecationssection in the docs for directions on how to update existing code.In the pytest
9.0.Xseries, it is possible to change the errors back into warnings as astopgap measure by adding this to your
pytest.inifile:But this will stop working when pytest
9.1is released.If you have concerns about the removal of a specific feature, please add a
comment to
13779.Deprecations (removal in next major release)
monkeypatch.syspath_prepend() <pytest.MonkeyPatch.syspath_prepend>now issues a deprecation warning when the prepended path contains legacy namespace packages (those usingpkg_resources.declare_namespace()).Users should migrate to native namespace packages (
420).See
monkeypatch-fixup-namespace-packagesfor details.Bug fixes
#13445: Made the type annotations of
pytest.skipand friends more spec-complaint to have them work across more type checkers.#13537: Fixed a bug in which
ExceptionGroupwith onlySkippedexceptions in teardown was not handled correctly and showed as error.#13598: Fixed possible collection confusion on Windows when short paths and symlinks are involved.
#13716: Fixed a bug where a nonsensical invocation like
pytest x.py[a](a file cannot be parametrized)Configuration
📅Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻Immortal: This PR will be recreated if closed unmerged. Getconfig help if that's undesired.
This PR was generated byMend Renovate. View therepository job log.