Commit Graph

2343 Commits

Author SHA1 Message Date
Sviatoslav Sydorenko 0971a95902
📝 Add a change note for PR #12522 2024-06-22 22:14:33 +02:00
Sviatoslav Sydorenko (Святослав Сидоренко) 329662e2ec
📝 Drop stray trailing period from the change note byline 2024-06-21 22:06:33 +02:00
Sviatoslav Sydorenko (Святослав Сидоренко) 24450e33e3
📝 Use explicit RST roles for built-in types in docs 2024-06-21 22:05:43 +02:00
lovetheguitar 9cf9cfabcb docs(12281.feature.rst): add changelog fragment 2024-06-21 20:51:01 +02:00
Farbod Ahmadian 34e28295a7
refactor: simplify bound method representation (#12492)
Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
Co-authored-by: Farbod Ahmadian <farbod@datachef.com>
2024-06-21 18:20:44 +02:00
Ronny Pfannschmidt c8948fca65
Merge pull request #12502 from webknjaz/maintenance/ci-plugin-update-draft-ux
🧪 Make a draft based plugin bump PR CI trigger
2024-06-21 15:48:49 +02:00
Ronny Pfannschmidt dab29d39d7
Merge pull request #12507 from webknjaz/maintenance/hotfixes/note/sphinx-towncrier-draft
📝 Add a change note for PR #12493
2024-06-21 15:26:11 +02:00
Sviatoslav Sydorenko 5d95f09b2a
📝 Add a change note for PR #12493 2024-06-21 15:11:12 +02:00
Sviatoslav Sydorenko a67327ac8e
📝 Add a change note to PR #12498 2024-06-21 14:14:28 +02:00
Sviatoslav Sydorenko 072cb5250e
📝 Add a change note for PR #12502 2024-06-21 14:11:07 +02:00
Sviatoslav Sydorenko e73db68642
📝 Add a change note for PR #12501 2024-06-21 13:35:47 +02:00
Sviatoslav Sydorenko 3ce1d658bd
🎨 Set up Git to only allow certain change notes 2024-06-21 13:35:47 +02:00
Sviatoslav Sydorenko 03be1ed8b1
📝💅 Split `trivial` change log category into 3
The new change note types are `packaging`, `contrib` and `misc`.
`packaging` is intended for the audience of downstream redistributors.
The `contrib` notes are meant to be documenting news affecting the
project contributors, their development, and processes.
Finally, `misc` is for things that don't fit anywhere but are still
desired to be documented for some reason.
2024-06-21 13:35:47 +02:00
Ronny Pfannschmidt bbe6b4a218
Merge pull request #12467 from RonnyPfannschmidt/ronny/new-annotations-try-2
from __future__ import annotations + migrate
2024-06-21 10:24:56 +02:00
Ronny Pfannschmidt 85e451a2cc add changelog entry 2024-06-20 11:10:04 +02:00
Sviatoslav Sydorenko cb179472bb
📝 Add change notes for PR #12469 2024-06-20 11:01:10 +02:00
Ronny Pfannschmidt 76f3f3da00 fix #11797: be more lenient on SequenceLike approx
this needs a validation as it allows partially implemented sequences
2024-06-18 17:01:24 +02:00
Ran Benita de47b73520 unittest: fix assertion errors on unittest reruns
This fixes unittest test reruns when using plugins like
pytest-rerunfailures.

The `instance` property uses AttributeError to check if the instance
needs to be initialized, so `del` is the correct way to clear it, not
setting to `None`.

Regressed in 8.2.2.
2024-06-07 10:21:15 +03:00
Ran Benita 4cd80e19c5 Merge pull request #12415 from pytest-dev/release-8.2.2
Prepare release 8.2.2

(cherry picked from commit f3a494cca3)
2024-06-04 16:52:15 +03:00
Ran Benita d4dbe771f0
Merge pull request #12409 from bluetech/reorder-items-perf
fixtures: fix catastrophic performance problem in `reorder_items`
2024-06-04 10:16:19 +03:00
Ran Benita e89d23b247 fixtures: fix catastrophic performance problem in `reorder_items`
Fix #12355.

In the issue, it was reported that the `reorder_items` has quadratic (or
worse...) behavior with certain simple parametrizations. After some
debugging I found that the problem happens because the "Fix
items_by_argkey order" loop keeps adding the same item to the deque,
and it reaches epic sizes which causes the slowdown.

I don't claim to understand how the `reorder_items` algorithm works, but
if as far as I understand, if an item already exists in the deque, the
correct thing to do is to move it to the front. Since a deque doesn't
have such an (efficient) operation, this switches to `OrderedDict` which
can efficiently append from both sides, deduplicate and move to front.
2024-06-04 10:15:50 +03:00
Michael Vogt 7be95f9b30
code: do not truncate args when running with -vvv (#12241)
Related to #2871.
2024-06-03 12:11:41 +00:00
Ran Benita 17065cb008 cacheprovider: fix "Directory not empty" crash from cache directory creation
Fix #12381

Test plan:
It's possible to write a deterministic test case for this, but somewhat
of a hassle so I tested it manually. I reproduced by removing existing
`.pytest_cache`, adding a sleep before the rename and running two
pytests. I verified that it doesn't reproduce after the fix.
2024-06-02 17:05:36 +03:00
James Frost 020db7ec04
Add html_baseurl to sphinx conf.py (#12364)
This is used to set the <link rel="canonical" href="X"> tag that points to the canonical version of the webpage. Including this indicates to search engines which version to include in their indexes, and should prevent older versions showing up.

Fixes #12363
2024-05-26 07:21:30 -03:00
Ran Benita c3c51037f0 unittest: fix class instances no longer released on test teardown since pytest 8.2.0
Fix #12367.
2024-05-26 10:18:42 +03:00
Nathan Goldbaum 889d9b28d7
Add thread safety section to flaky test docs (#12359)
Closes #12356
2024-05-24 08:16:44 -03:00
Sam Jirovec cbf6bd9dd2
Issue #12290 - Docs using Furo Theme W/ Dark Mode (#12326)
* furo theme for docs site

* removing duplicate tocs from deprecations and reference pages

* removing pallets references in code and config

* reverting trainings to sidebar

* removed sphinx style and unpinned packaging version

* updated styles
2024-05-21 13:56:18 +00:00
pytest bot 32baa0b93d Prepare release version 8.2.1
(cherry picked from commit 66ff8dffdf)
2024-05-19 22:11:09 +03:00
Ran Benita 1cb704ff2c Add Python 3.13 (beta1) support 2024-05-19 09:25:13 +03:00
Bruno Oliveira 635fbe2bff
Attest package provenance (#12333)
Use the new build provenance support added in [build-and-inspect-python-package 2.5.0](https://github.com/hynek/build-and-inspect-python-package/blob/main/CHANGELOG.md#250---2024-05-13).

More information: https://github.blog/2024-05-02-introducing-artifact-attestations-now-in-public-beta/

Tested also in https://github.com/pytest-dev/pytest-mock/pull/431.

Note: even though it is technically necessary only for the `deploy` workflow, as the `test` workflow does not publish its packages, decided to always attest the provenance in both cases to avoid any surprises related to this (say a misconfiguration) when deploying.
2024-05-17 08:19:13 -03:00
Ran Benita 1acf56d033 fixtures: fix non-working package-scope parametrization reordering
The `.parent` was incorrectly removed in
a21fb87a90, but it was actually correct
(well, it assumes that Module.path.parent == Package.path, which I'm not
sure is always correct, but that's a different matter). Restore it.

Fix #12328.
2024-05-15 17:29:43 +03:00
Ran Benita 3a64c47f1f cacheprovider: fix `.pytest_cache` not being world-readable
Fix #12308.
2024-05-14 23:47:12 +03:00
Ran Benita 704792ecbd
Merge pull request #12311 from bluetech/pkg-collect-perm-error
python: add workaround for permission error crashes from non-selected directories
2024-05-13 20:32:23 +03:00
Ran Benita 37489d3c6c python,unittest: don't collect abstract classes
Fix #12275.
2024-05-13 13:00:47 +03:00
Ran Benita 90a3ef2f36 python: add workaround for permission error crashes from non-selected directories
Fix #12120.
2024-05-12 22:38:49 +03:00
Yutian Li 5af46f3d4e
Fix crashing under squashfuse_ll read-only mounts (#12301)
Fixes #12300
2024-05-09 15:04:58 -03:00
Brian Okken 8efbefb2d7
New --xfail-tb flag (#12280)
Fix #12231
2024-05-07 14:37:00 -03:00
Anita Hammer 97610067ac
Handle KeyboardInterrupt and SystemExit at collection time (#12191) 2024-05-02 11:59:09 +00:00
Ben Brown 4c5298c395
Add back "Fix teardown error reporting when --maxfail=1 (#11721)" (#12279)
Closes #11706.

Originally fixed in #11721, but then reverted in #12022 due to a regression in pytest-xdist.

The regression was fixed on the pytest-xdist side in pytest-dev/pytest-xdist#1026.
2024-05-02 10:42:31 +03:00
Ran Benita feaae2fb35
Merge pull request #12264 from bluetech/reraise-with-original-tb
fixtures,runner: fix tracebacks getting longer and longer
2024-04-29 20:02:44 +03:00
dj 2ede8778d0
Document using PYTEST_VERSION to detect if a code is running inside pytest (#12153)
Related to #9502
2024-04-28 15:52:29 -03:00
Ran Benita 3e81cb2f45 runner: fix tracebacks for failed collectors getting longer and longer
Refs https://github.com/pytest-dev/pytest/issues/12204#issuecomment-2081239376
2024-04-28 13:30:05 +03:00
Ran Benita 0b91d5e3e8 fixtures: fix tracebacks for higher-scoped failed fixtures getting longer and longer
Fix #12204.
2024-04-28 13:06:32 +03:00
Ran Benita 50d1e81713 terminal: fix progress percentages not aligning correctly in xdist
Fix #7166
2024-04-28 11:33:18 +03:00
Bruno Oliveira 79ca819e59 Merge pull request #12257 from pytest-dev/release-8.2.0
Prepare release 8.2.0

(cherry picked from commit 69c3bcea36)
2024-04-27 20:36:02 -03:00
Daniel Miller 7e7503c0b0
unittest: report class cleanup exceptions (#12250)
Fixes #11728

---------

Co-authored-by: Bruno Oliveira <bruno@soliv.dev>
2024-04-27 09:49:05 -03:00
Bruno Oliveira 93c2cdf6d6
cherry-pick release-8.1.2 (#12252)
(cherry picked from commit 7df3dbc545)
2024-04-26 15:25:44 -03:00
Shekhar verma 4eb8b6d525
Changed importError to ModuleNotFoundError (#12220)
* Changed importError to ModuleNotFoundError

* added testing for importorskip

* added exc_types parameter in importorskip

* Added warning and Test Cases

* Improve tests and docs

* Improve deprecation docs

* Change exc_type to kw only

* Apply suggestions from code review

Co-authored-by: Florian Bruhin <me@the-compiler.org>

* Fix check

---------

Co-authored-by: Bruno Oliveira <bruno@soliv.dev>
Co-authored-by: Florian Bruhin <me@the-compiler.org>
2024-04-26 09:48:57 +02:00
poulami-sau 5cffef7f07
Fixed Bug Regarding Attribute Error in pytest.approx For Types Implicitly Convertible to Numpy Arrays (#12232)
* added test case in testing/python/approx.py based on test case provided by reporter in issue #12114
* test cases pass for pytest testing/python/approx.py
* expanded the type annotation to include objects which may cast to a array and renamed other_side to other_side_as_array and asserted that it is not none
2024-04-23 10:45:33 +02:00
Ran Benita 58136c5376 hookspec: deprecate hookimpls requesting py.path parameters 2024-04-21 11:37:56 +03:00