Skip to content

Commit

Permalink
Merge branch 'main' into fix-invalid-regex-in-filterwarnings
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert authored Jan 29, 2025
2 parents 1581a63 + 2f36984 commit 49f0dff
Show file tree
Hide file tree
Showing 45 changed files with 1,157 additions and 258 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
persist-credentials: false

- name: Build and Check Package
uses: hynek/build-and-inspect-python-package@v2.11.0
uses: hynek/build-and-inspect-python-package@v2.12.0
with:
attest-build-provenance-github: 'true'

Expand All @@ -56,7 +56,7 @@ jobs:
path: dist

- name: Publish package to PyPI
uses: pypa/[email protected].3
uses: pypa/[email protected].4
with:
attestations: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
fetch-depth: 0
persist-credentials: false
- name: Build and Check Package
uses: hynek/build-and-inspect-python-package@v2.11.0
uses: hynek/build-and-inspect-python-package@v2.12.0

build:
needs: [package]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-plugin-list.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:

- name: Create Pull Request
id: pr
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f
with:
commit-message: '[automated] Update plugin list'
author: 'pytest bot <[email protected]>'
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.8.3"
rev: "v0.9.3"
hooks:
- id: ruff
args: ["--fix"]
Expand All @@ -12,7 +12,7 @@ repos:
- id: end-of-file-fixer
- id: check-yaml
- repo: https://github.com/woodruffw/zizmor-pre-commit
rev: v0.9.2
rev: v1.2.2
hooks:
- id: zizmor
- repo: https://github.com/adamchainz/blacken-docs
Expand All @@ -21,7 +21,7 @@ repos:
- id: blacken-docs
additional_dependencies: [black==24.1.1]
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
rev: v2.4.0
hooks:
- id: codespell
args: ["--toml=pyproject.toml"]
Expand All @@ -32,7 +32,7 @@ repos:
hooks:
- id: python-use-type-annotations
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
rev: v1.14.1
hooks:
- id: mypy
files: ^(src/|testing/|scripts/)
Expand All @@ -54,7 +54,7 @@ repos:
# https://pyproject-fmt.readthedocs.io/en/latest/#calculating-max-supported-python-version
additional_dependencies: ["tox>=4.9"]
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.0
rev: v3.19.1
hooks:
- id: pyupgrade
args:
Expand Down
3 changes: 3 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Alice Purcell
Allan Feldman
Aly Sivji
Amir Elkess
Ammar Askar
Anatoly Bubenkoff
Anders Hovmöller
Andras Mitzki
Expand Down Expand Up @@ -142,6 +143,7 @@ Eero Vaher
Eli Boyarski
Elizaveta Shashkova
Éloi Rivard
Emil Hjelm
Endre Galaczi
Eric Hunsberger
Eric Liu
Expand Down Expand Up @@ -434,6 +436,7 @@ Tim Hoffmann
Tim Strazny
TJ Bruno
Tobias Diez
Tobias Petersen
Tom Dalton
Tom Viner
Tomáš Gavenčiak
Expand Down
6 changes: 5 additions & 1 deletion RELEASING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,8 @@ Both automatic and manual processes described above follow the same steps from t
* [email protected] (all releases)
* [email protected] (only major/minor releases)

And announce it on `Twitter <https://twitter.com/>`_ and `BlueSky <https://bsky.app/>`_ with the ``#pytest`` hashtag.
And announce it with the ``#pytest`` hashtag on:

* `Bluesky <https://bsky.app>`_
* `Fosstodon <https://fosstodon.org>`_
* `Twitter/X <https://x.com>`_
18 changes: 18 additions & 0 deletions changelog/10224.improvement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
pytest's ``short`` and ``long`` traceback styles (:ref:`how-to-modifying-python-tb-printing`)
now have partial :pep:`657` support and will show specific code segments in the
traceback.

.. code-block:: pytest
================================= FAILURES =================================
_______________________ test_gets_correct_tracebacks _______________________
test_tracebacks.py:12: in test_gets_correct_tracebacks
assert manhattan_distance(p1, p2) == 1
^^^^^^^^^^^^^^^^^^^^^^^^^^
test_tracebacks.py:6: in manhattan_distance
return abs(point_1.x - point_2.x) + abs(point_1.y - point_2.y)
^^^^^^^^^
E AttributeError: 'NoneType' object has no attribute 'x'
-- by :user:`ammaraskar`
1 change: 1 addition & 0 deletions changelog/11777.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed issue where sequences were still being shortened even with ``-vv`` verbosity.
3 changes: 3 additions & 0 deletions changelog/12713.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
New `--force-short-summary` option to force condensed summary output regardless of verbosity level.

This lets users still see condensed summary output of failures for quick reference in log files from job outputs, being especially useful if non-condensed output is very verbose.
8 changes: 8 additions & 0 deletions changelog/13115.improvement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Allows supplying ``ExceptionGroup[Exception]`` and ``BaseExceptionGroup[BaseException]`` to ``pytest.raises`` to keep full typing on :class:`ExceptionInfo <pytest.ExceptionInfo>`:

.. code-block:: python
with pytest.raises(ExceptionGroup[Exception]) as exc_info:
some_function()
Parametrizing with other exception types remains an error - we do not check the types of child exceptions and thus do not permit code that might look like we do.
15 changes: 15 additions & 0 deletions changelog/13122.improvement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
The ``--stepwise`` mode received a number of improvements:

* It no longer forgets the last failed test in case pytest is executed later without the flag.

This enables the following workflow:

1. Execute pytest with ``--stepwise``, pytest then stops at the first failing test;
2. Iteratively update the code and run the test in isolation, without the ``--stepwise`` flag (for example in an IDE), until it is fixed.
3. Execute pytest with ``--stepwise`` again and pytest will continue from the previously failed test, and if it passes, continue on to the next tests.

Previously, at step 3, pytest would start from the beginning, forgetting the previously failed test.

This change however might cause issues if the ``--stepwise`` mode is used far apart in time, as the state might get stale, so the internal state will be reset automatically in case the test suite changes (for now only the number of tests are considered for this, we might change/improve this on the future).

* New ``--stepwise-reset``/``--sw-reset`` flag, allowing the user to explicitly reset the stepwise state and restart the workflow from the beginning.
1 change: 1 addition & 0 deletions changelog/13125.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
:confval:`console_output_style` now supports ``times`` to show execution time of each test.
7 changes: 7 additions & 0 deletions doc/en/contact.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ Chat
<https://web.libera.chat/#pytest>`_)
- ``#pytest`` `on Matrix <https://matrix.to/#/#pytest:matrix.org>`_.

Microblogging
-------------

- Bluesky: `@pytest.org <https://bsky.app/profile/pytest.org>`_
- Mastodon: `@[email protected] <https://fosstodon.org/@pytest>`_
- Twitter/X: `@pytestdotorg <https://x.com/pytestdotorg>`_

Mail
----

Expand Down
6 changes: 3 additions & 3 deletions doc/en/example/assertion/failure_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,9 @@ class A:
a = 1

b = 2
assert (
A.a == b
), "A.a appears not to be b\nor does not appear to be b\none of those"
assert A.a == b, (
"A.a appears not to be b\nor does not appear to be b\none of those"
)

def test_custom_repr(self):
class JSON:
Expand Down
2 changes: 1 addition & 1 deletion doc/en/how-to/cache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ The new config.cache object
Plugins or conftest.py support code can get a cached value using the
pytest ``config`` object. Here is a basic example plugin which
implements a :ref:`fixture <fixture>` which re-uses previously created state
implements a :ref:`fixture <fixture>` which reuses previously created state
across pytest invocations:

.. code-block:: python
Expand Down
Loading

0 comments on commit 49f0dff

Please sign in to comment.