#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: 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 <args-from-file>{.interpreted-text role="ref"} for details.
Improvements
#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: For unittest-based tests, exceptions during class cleanup (as raised by functions registered with TestCase.addClassCleanup <unittest.TestCase.addClassCleanup>{.interpreted-text role="meth"}) are now reported instead of silently failing.
#11777: Text is no longer truncated in the short test summary info section when -vv is given.
#12112: Improved namespace packages detection when consider_namespace_packages{.interpreted-text role="confval"} is enabled, covering more situations (like editable installs).
#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: 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 <pytest.FixtureRequest.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.
[#1071](https://github.com/pytest-dev/pytest-xdist/issues/1071) <https://github.com/pytest-dev/pytest-xdist/issues/1071>_: Add backward compatibility for deadlock issue with the execnet new main_thread_only "execmodel" triggered when pytest-cov accesses rinfo.
pytest-xdist 3.6.0 (2024-04-19)
This release was YANKED due to a regression fixed in 3.6.1.
Features
[#1027](https://github.com/pytest-dev/pytest-xdist/issues/1027) <https://github.com/pytest-dev/pytest-xdist/pull/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 #620pytest-dev/pytest-xdist#620`__).
Bug Fixes
[#1024](https://github.com/pytest-dev/pytest-xdist/issues/1024) <https://github.com/pytest-dev/pytest-xdist/issues/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](https://github.com/pytest-dev/pytest-xdist/issues/1028) <https://github.com/pytest-dev/pytest-xdist/issues/1028>_: Fixed compatibility issue between looponfail and editable installs.
[#620](https://github.com/pytest-dev/pytest-xdist/issues/620) <https://github.com/pytest-dev/pytest-xdist/issues/620>_: Use the new main_thread_onlyexecnet "execmodel" so that code which expects to only run in the main thread will now work as expected.
[#937](https://github.com/pytest-dev/pytest-xdist/issues/937) <https://github.com/pytest-dev/pytest-xdist/issues/937>_: Fixed a bug where plugin would raise an incompatibility error with --pdb despite using -n0.
Removals
[#1053](https://github.com/pytest-dev/pytest-xdist/issues/1053) <https://github.com/pytest-dev/pytest-xdist/issues/1053>_: Dropped support for Python 3.7.
[#1057](https://github.com/pytest-dev/pytest-xdist/issues/1057) <https://github.com/pytest-dev/pytest-xdist/issues/1057>_: pytest>=7.0.0 is now required.
execnet>=2.1.0 is now required.
Trivial Changes
[#1020](https://github.com/pytest-dev/pytest-xdist/issues/1020) <https://github.com/pytest-dev/pytest-xdist/issues/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 <https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html#summary>_ for alternatives.
[#415](https://github.com/pytest-dev/pytest-mock/issues/415) <https://github.com/pytest-dev/pytest-mock/pull/415>_: MockType and AsyncMockType can be imported from pytest_mock for type annotation purposes.
[#420](https://github.com/pytest-dev/pytest-mock/issues/420) <https://github.com/pytest-dev/pytest-mock/issues/420>_: Fixed a regression which would cause mocker.patch.object to not being properly cleared between tests.
3.13.0 (2024-03-21)
[#417](https://github.com/pytest-dev/pytest-mock/issues/417) <https://github.com/pytest-dev/pytest-mock/pull/417>_: spy now has spy_return_list, which is a list containing all the values returned by the spied function.
pytest-mock now requires pytest>=6.2.5.
[#410](https://github.com/pytest-dev/pytest-mock/issues/410) <https://github.com/pytest-dev/pytest-mock/pull/410>: pytest-mock'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 <https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html#summary> for alternatives.
3.12.0 (2023-10-19)
Added support for Python 3.12.
Dropped support for EOL Python 3.7.
mocker.resetall() now also resets mocks created by mocker.create_autospec ([#390](https://github.com/pytest-dev/pytest-mock/issues/390)_).
Removed support for xdist rsync (now deprecated).
Contributed by Matthias Reichenbach in [#623](https://github.com/pytest-dev/pytest-cov/issues/623) <https://github.com/pytest-dev/pytest-cov/pull/623>_.
Switched docs theme to Furo.
Various legacy Python cleanup and CI improvements.
Contributed by Christian Clauss and Hugo van Kemenade in
[#630](https://github.com/pytest-dev/pytest-cov/issues/630) <https://github.com/pytest-dev/pytest-cov/pull/630>,
[#631](https://github.com/pytest-dev/pytest-cov/issues/631) <https://github.com/pytest-dev/pytest-cov/pull/631>,
[#632](https://github.com/pytest-dev/pytest-cov/issues/632) <https://github.com/pytest-dev/pytest-cov/pull/632>_ and
[#633](https://github.com/pytest-dev/pytest-cov/issues/633) <https://github.com/pytest-dev/pytest-cov/pull/633>_.
Added a pyproject.toml example in the docs.
Contributed by Dawn James in [#626](https://github.com/pytest-dev/pytest-cov/issues/626) <https://github.com/pytest-dev/pytest-cov/pull/626>_.
Modernized project's pre-commit hooks to use ruff. Initial POC contributed by
Christian Clauss in [#584](https://github.com/pytest-dev/pytest-cov/issues/584) <https://github.com/pytest-dev/pytest-cov/pull/584>_.
4.1.0 (2023-05-24)
Updated CI with new Pythons and dependencies.
Removed rsyncdir support. This makes pytest-cov compatible with xdist 3.0.
Contributed by Sorin Sbarnea in [#558](https://github.com/pytest-dev/pytest-cov/issues/558) <https://github.com/pytest-dev/pytest-cov/pull/558>_.
Optimized summary generation to not be performed if no reporting is active (for example,
when --cov-report='' is used without --cov-fail-under).
Contributed by Jonathan Stewmon in [#589](https://github.com/pytest-dev/pytest-cov/issues/589) <https://github.com/pytest-dev/pytest-cov/pull/589>_.
Added support for JSON reporting.
Contributed by Matthew Gamble in [#582](https://github.com/pytest-dev/pytest-cov/issues/582) <https://github.com/pytest-dev/pytest-cov/pull/582>_.
Refactored code to use f-strings.
Contributed by Mark Mayo in [#572](https://github.com/pytest-dev/pytest-cov/issues/572) <https://github.com/pytest-dev/pytest-cov/pull/572>_.
Fixed a skip in the test suite for some old xdist.
Contributed by a bunch of people in [#565](https://github.com/pytest-dev/pytest-cov/issues/565) <https://github.com/pytest-dev/pytest-cov/pull/565>_.
4.0.0 (2022-09-28)
Note that this release drops support for multiprocessing.
--cov-fail-under no longer causes pytest --collect-only to fail
Contributed by Zac Hatfield-Dodds in [#511](https://github.com/pytest-dev/pytest-cov/issues/511) <https://github.com/pytest-dev/pytest-cov/pull/511>_.
Dropped support for multiprocessing (mostly because issue 82408 <https://github.com/python/cpython/issues/82408>_). This feature was
mostly working but very broken in certain scenarios and made the test suite very flaky and slow.
There is builtin multiprocessing support in coverage and you can migrate to that. All you need is this in your
.coveragerc::
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
- `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
- `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency
- `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions
Updates the requirements on pytest, pytest-xdist, pytest-mock, pytest-cov, ruff, pylint and sphinx to permit the latest version. Updates
pytest
to 8.2.0Release notes
Sourced from pytest's releases.
... (truncated)
Commits
6bd3f31
Tweak changelog for 8.2.09b6219b
Prepare release version 8.2.0835765c
Merge pull request #12130 from bluetech/fixtures-inline7e7503c
unittest: report class cleanup exceptions (#12250)882c4da
fixtures: inlinefail_fixturefunc
2e8fb9f
fixtures: extract a_check_fixturedef
methodacf2971
fixtures: inline_getnextfixturedef
into_get_active_fixturedef
3c77aec
fixtures: move "request" check earlyd217d68
fixtures: inline_compute_fixture_value
530be28
fixtures: use early return in_get_active_fixturedef
Updates
pytest-xdist
to 3.6.1Changelog
Sourced from pytest-xdist's changelog.
... (truncated)
Commits
4dd2978
Release 3.6.1b397288
Merge pull request #1072 from zmedico/gateway-cache-rinfo12b3cce
Cache execnet gateway rinfo during WorkerController setupc93a106
build(deps): bump hynek/build-and-inspect-python-package (#1066)52e2022
[pre-commit.ci] pre-commit autoupdate (#1073)699f939
Merge pull request #1070 from pytest-dev/release-3.6.080bc0b8
Release 3.6.020e3ac7
Use execnet main_thread_only execmodel (#1027)0a4238f
Merge pull request #1067 from pytest-dev/pre-commit-ci-update-config0686279
[pre-commit.ci] pre-commit autoupdateUpdates
pytest-mock
to 3.14.0Release notes
Sourced from pytest-mock's releases.
Changelog
Sourced from pytest-mock's changelog.
... (truncated)
Commits
8733134
Update CHANGELOG for 3.14.05257e3c
Refactor MockCache to have a narrow interface4faf92a
Fix regression with mocker.patch not being undone correctly6bd8712
Drop pre-Python 3.8 support code366966b
ExportMockType
/AsyncMockType
for type annotations (#415)852116b
Merge pull request #418 from pytest-dev/release-3.13.0ef9461b
Add instructions on how to start deploy from command-line5b9d285
Release 3.13.06d5d6dc
Implementspy_return_list
(#417)dc28a0e
[pre-commit.ci] pre-commit autoupdate (#416)Updates
pytest-cov
to 5.0.0Changelog
Sourced from pytest-cov's changelog.
... (truncated)
Commits
5295ce0
Bump version: 4.1.0 → 5.0.01181b06
Update changelog.9757222
Fix a minor grammar error (#636)9f5cd81
Cleanup releasing instructions. Closes #616.93b5047
Add test for pyproject.toml loading without explicit --cov-config. Ref #508.ff50860
docs: add config instructions for pyproject.toml.4a5a4b5
Keep GitHub Actions up to date with GitHub's Dependabot1d7f559
Fix or remove URLs that are causing docs tests to fail6a5af8e
Update changelog.d9fe8df
Switch to furo. Closes #618.Updates
ruff
to 0.4.4Release notes
Sourced from ruff's releases.
Changelog
Sourced from ruff's changelog.
... (truncated)
Commits
3e8878a
Bump version to v0.4.4 (#11352)b6b4ad9
[red-knot]@​override
lint rule (#11282)dd42961
[pylint
] Detectpathlib.Path.open
calls inunspecified-encoding
(`PLW15...c80c171
[red-knot] Vendor typeshed's stdlib (#11340)e2fe177
Revert "Simplify arithmetic operation in logical lines checker (#11346)" (#11...e9d1cdd
Simplify arithmetic operation in logical lines checker (#11346)dfe4291
Improveruff_python_semantic::all::extract_all_names()
(#11335)4541337
[red-knot] Remove\<Db: SemanticDb>
contraints in favor of dynamic dispatch ...8e9ddee
Ignore end-of-line comments when determining blank line rules (#11342)702d2fa
Make B024 and B027 documentation more nuanced (#11341)Updates
pylint
to 3.2.0Commits
b738d23
Bump pylint to 3.2.0, update changelog040ce17
Upgrade the contributors lists743a04d
[performance] Check that 'trailing-comma-tuple' is enabled only once (#9620)b4a9535
[pre-commit.ci] pre-commit autoupdate (#9621)a4f9b86
[pre-commit.ci] pre-commit autoupdate4f0c7ac
Merge maintenance/3.1.x into main following 3.1.1 release (#9618)0d8ef10
Merge maintenance/3.1.x into main following 3.1.1 releasee53fdb6
Bump furo from 2024.4.27 to 2024.5.6 (#9617)814bf94
Bump actions/checkout from 4.1.4 to 4.1.5 (#9616)fd6790b
Add ignored modules to Astroid module deny list (#9504)Updates
sphinx
to 7.3.7Release notes
Sourced from sphinx's releases.
Changelog
Sourced from sphinx's changelog.
... (truncated)
Commits
de4ac2f
Bump to 7.3.7 final4a0c9dd
Return the default value for unsupported theme configuration sections62c3bad
Re-exportpy_sig_re
from the Python domain3bcc669
Defer loading entry-point themes until neededfa4563f
Bump version630b4fb
Bump to 7.3.6 final740b964
fixup! Elaborate a little more in the warning message forconfig.cache
141f3ec
Elaborate a little more in the warning message forconfig.cache
af27188
Addconfig.cache
to the list of warning typesbe2b083
Re-export more names insphinx.domains.python
(#12297)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show