pytest-dev/pytest (pytest)
### [`v8.2.0`](https://togithub.com/pytest-dev/pytest/releases/tag/8.2.0)
[Compare Source](https://togithub.com/pytest-dev/pytest/compare/8.1.2...8.2.0)
# pytest 8.2.0 (2024-04-27)
## Deprecations
- [#12069](https://togithub.com/pytest-dev/pytest/issues/12069): A deprecation warning is now raised when implementations of one of the following hooks request a deprecated `py.path.local` parameter instead of the `pathlib.Path` parameter which replaced it:
- `pytest_ignore_collect`{.interpreted-text role="hook"} - the `path` parameter - use `collection_path` instead.
- `pytest_collect_file`{.interpreted-text role="hook"} - the `path` parameter - use `file_path` instead.
- `pytest_pycollect_makemodule`{.interpreted-text role="hook"} - the `path` parameter - use `module_path` instead.
- `pytest_report_header`{.interpreted-text role="hook"} - the `startdir` parameter - use `start_path` instead.
- `pytest_report_collectionfinish`{.interpreted-text role="hook"} - the `startdir` parameter - use `start_path` instead.
The replacement parameters are available since pytest 7.0.0.
The old parameters will be removed in pytest 9.0.0.
See `legacy-path-hooks-deprecated`{.interpreted-text role="ref"} for more details.
## Features
- [#11871](https://togithub.com/pytest-dev/pytest/issues/11871): Added support for reading command line arguments from a file using the prefix character `@`, like e.g.: `pytest @tests.txt`. The file must have one argument per line.
See `Read arguments from file `{.interpreted-text role="ref"} for details.
## Improvements
- [#11523](https://togithub.com/pytest-dev/pytest/issues/11523): `pytest.importorskip`{.interpreted-text role="func"} will now issue a warning if the module could be found, but raised `ImportError`{.interpreted-text role="class"} instead of `ModuleNotFoundError`{.interpreted-text role="class"}.
The warning can be suppressed by passing `exc_type=ImportError` to `pytest.importorskip`{.interpreted-text role="func"}.
See `import-or-skip-import-error`{.interpreted-text role="ref"} for details.
- [#11728](https://togithub.com/pytest-dev/pytest/issues/11728): For `unittest`-based tests, exceptions during class cleanup (as raised by functions registered with `TestCase.addClassCleanup `{.interpreted-text role="meth"}) are now reported instead of silently failing.
- [#11777](https://togithub.com/pytest-dev/pytest/issues/11777): Text is no longer truncated in the `short test summary info` section when `-vv` is given.
- [#12112](https://togithub.com/pytest-dev/pytest/issues/12112): Improved namespace packages detection when `consider_namespace_packages`{.interpreted-text role="confval"} is enabled, covering more situations (like editable installs).
- [#9502](https://togithub.com/pytest-dev/pytest/issues/9502): Added `PYTEST_VERSION`{.interpreted-text role="envvar"} environment variable which is defined at the start of the pytest session and undefined afterwards. It contains the value of `pytest.__version__`, and among other things can be used to easily check if code is running from within a pytest run.
## Bug Fixes
- [#12065](https://togithub.com/pytest-dev/pytest/issues/12065): Fixed a regression in pytest 8.0.0 where test classes containing `setup_method` and tests using `@staticmethod` or `@classmethod` would crash with `AttributeError: 'NoneType' object has no attribute 'setup_method'`.
Now the `request.instance `{.interpreted-text role="attr"} attribute of tests using `@staticmethod` and `@classmethod` is no longer `None`, but a fresh instance of the class, like in non-static methods.
Previously it was `None`, and all fixtures of such tests would share a single `self`.
- [#12135](https://togithub.com/pytest-dev/pytest/issues/12135): Fixed issue where fixtures adding their finalizer multiple times to fixtures they request would cause unreliable and non-intuitive teardown ordering in some instances.
- [#12194](https://togithub.com/pytest-dev/pytest/issues/12194): Fixed a bug with `--importmode=importlib` and `--doctest-modules` where child modules did not appear as attributes in parent modules.
- [#1489](https://togithub.com/pytest-dev/pytest/issues/1489): Fixed some instances where teardown of higher-scoped fixtures was not happening in the reverse order they were initialized in.
## Trivial/Internal Changes
- [#12069](https://togithub.com/pytest-dev/pytest/issues/12069): `pluggy>=1.5.0` is now required.
- [#12167](https://togithub.com/pytest-dev/pytest/issues/12167): `cache `{.interpreted-text role="ref"}: create supporting files (`CACHEDIR.TAG`, `.gitignore`, etc.) in a temporary directory to provide atomic semantics.
### [`v8.1.2`](https://togithub.com/pytest-dev/pytest/releases/tag/8.1.2)
[Compare Source](https://togithub.com/pytest-dev/pytest/compare/8.1.1...8.1.2)
# pytest 8.1.2 (2024-04-26)
## Bug Fixes
- [#12114](https://togithub.com/pytest-dev/pytest/issues/12114): Fixed error in `pytest.approx`{.interpreted-text role="func"} when used with \[numpy]{.title-ref} arrays and comparing with other types.
pytest-dev/pytest-xdist (pytest-xdist)
### [`v3.6.1`](https://togithub.com/pytest-dev/pytest-xdist/blob/HEAD/CHANGELOG.rst#pytest-xdist-361-2024-04-28)
[Compare Source](https://togithub.com/pytest-dev/pytest-xdist/compare/v3.6.0...v3.6.1)
\===============================
## Bug Fixes
- `#1071 `\_: Add backward compatibility for deadlock issue with the `execnet` new `main_thread_only` "execmodel" triggered when pytest-cov accesses rinfo.
### [`v3.6.0`](https://togithub.com/pytest-dev/pytest-xdist/blob/HEAD/CHANGELOG.rst#pytest-xdist-360-2024-04-19)
[Compare Source](https://togithub.com/pytest-dev/pytest-xdist/compare/v3.5.0...v3.6.0)
\===============================
This release was YANKED due to a regression fixed in 3.6.1.
## Features
- `#1027 `\_:`pytest-xdist` workers now always execute the tests in the main thread.
Previously some tests might end up executing in a separate thread other than `main` in the workers, due to some internal ` execnet`` details. This can cause problems specially with async frameworks where the event loop is running in the ``main`` thread (for example `[#620](https://togithub.com/pytest-dev/pytest-xdist/issues/620) [#620](https://togithub.com/pytest-dev/pytest-xdist/issues/620)\`\__).
## Bug Fixes
- `#1024 `\_: Added proper handling of `shouldstop` (such as set by `--max-fail`) and `shouldfail` conditions in workers.
Previously, a worker might have continued executing further tests before the controller could terminate the session.
- `#1028 `\_: Fixed compatibility issue between `looponfail` and editable installs.
- `#620 `\_: Use the new `main_thread_only` `execnet` "execmodel" so that code which expects to only run in the main thread will now work as expected.
- `#937 `\_: Fixed a bug where plugin would raise an incompatibility error with `--pdb` despite using `-n0`.
## Removals
- `#1053 `\_: Dropped support for Python 3.7.
- `#1057 `\_: pytest>=7.0.0 is now required.
execnet>=2.1.0 is now required.
## Trivial Changes
- `#1020 `\_: pytest-xdist's `setup.py` file is removed.
If you relied on this file, e.g. to install pytest using `setup.py install`,
please see `Why you shouldn't invoke setup.py directly `\_ for alternatives.
- `#1057 `\_: The internals of pytest-xdist are now fully typed. The typing is not exposed yet.
- `#996 `\_: Adjusted license file format and content to ensure security scanners will identity the license.
Configuration
📅 Schedule: Branch creation - "before 3am on Monday" in timezone Asia/Tokyo, Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
[ ] If you want to rebase/retry this PR, check this box
This PR has been generated by Mend Renovate. View repository job log here.
This PR contains the following updates:
==0.21.1
->==0.21.2
8.1.1
->8.2.0
3.5.0
->3.6.1
Release Notes
pytest-dev/pytest (pytest)
### [`v8.2.0`](https://togithub.com/pytest-dev/pytest/releases/tag/8.2.0) [Compare Source](https://togithub.com/pytest-dev/pytest/compare/8.1.2...8.2.0) # pytest 8.2.0 (2024-04-27) ## Deprecations - [#12069](https://togithub.com/pytest-dev/pytest/issues/12069): A deprecation warning is now raised when implementations of one of the following hooks request a deprecated `py.path.local` parameter instead of the `pathlib.Path` parameter which replaced it: - `pytest_ignore_collect`{.interpreted-text role="hook"} - the `path` parameter - use `collection_path` instead. - `pytest_collect_file`{.interpreted-text role="hook"} - the `path` parameter - use `file_path` instead. - `pytest_pycollect_makemodule`{.interpreted-text role="hook"} - the `path` parameter - use `module_path` instead. - `pytest_report_header`{.interpreted-text role="hook"} - the `startdir` parameter - use `start_path` instead. - `pytest_report_collectionfinish`{.interpreted-text role="hook"} - the `startdir` parameter - use `start_path` instead. The replacement parameters are available since pytest 7.0.0. The old parameters will be removed in pytest 9.0.0. See `legacy-path-hooks-deprecated`{.interpreted-text role="ref"} for more details. ## Features - [#11871](https://togithub.com/pytest-dev/pytest/issues/11871): Added support for reading command line arguments from a file using the prefix character `@`, like e.g.: `pytest @tests.txt`. The file must have one argument per line. See `Read arguments from filepytest-dev/pytest-xdist (pytest-xdist)
### [`v3.6.1`](https://togithub.com/pytest-dev/pytest-xdist/blob/HEAD/CHANGELOG.rst#pytest-xdist-361-2024-04-28) [Compare Source](https://togithub.com/pytest-dev/pytest-xdist/compare/v3.6.0...v3.6.1) \=============================== ## Bug Fixes - `#1071Configuration
📅 Schedule: Branch creation - "before 3am on Monday" in timezone Asia/Tokyo, Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR has been generated by Mend Renovate. View repository job log here.