Skip to content

Commit 8d22df0

Browse files
authored
Merge branch 'main' into py312-ci
2 parents 8d44278 + 9e491f4 commit 8d22df0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1019
-370
lines changed

.github/workflows/stale.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: close needs-information issues
2+
on:
3+
schedule:
4+
- cron: "30 1 * * *"
5+
workflow_dispatch:
6+
7+
jobs:
8+
close-issues:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
12+
steps:
13+
- uses: actions/stale@v8
14+
with:
15+
debug-only: false
16+
days-before-issue-stale: 14
17+
days-before-issue-close: 7
18+
only-labels: "status: needs information"
19+
stale-issue-label: "stale"
20+
stale-issue-message: "This issue is stale because it has been open for 14 days with no activity."
21+
close-issue-message: "This issue was closed because it has been inactive for 7 days since being marked as stale."
22+
days-before-pr-stale: -1
23+
days-before-pr-close: -1

.pre-commit-config.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
default_language_version:
2-
python: "3.10"
31
repos:
42
- repo: https://github.com/psf/black
53
rev: 23.3.0
@@ -23,7 +21,7 @@ repos:
2321
exclude: _pytest/(debugging|hookspec).py
2422
language_version: python3
2523
- repo: https://github.com/PyCQA/autoflake
26-
rev: v2.0.2
24+
rev: v2.1.1
2725
hooks:
2826
- id: autoflake
2927
name: autoflake
@@ -38,13 +36,13 @@ repos:
3836
additional_dependencies:
3937
- flake8-typing-imports==1.12.0
4038
- flake8-docstrings==1.5.0
41-
- repo: https://github.com/asottile/reorder_python_imports
39+
- repo: https://github.com/asottile/reorder-python-imports
4240
rev: v3.9.0
4341
hooks:
4442
- id: reorder-python-imports
4543
args: ['--application-directories=.:src', --py37-plus]
4644
- repo: https://github.com/asottile/pyupgrade
47-
rev: v3.3.1
45+
rev: v3.4.0
4846
hooks:
4947
- id: pyupgrade
5048
args: [--py37-plus]
@@ -58,7 +56,7 @@ repos:
5856
hooks:
5957
- id: python-use-type-annotations
6058
- repo: https://github.com/pre-commit/mirrors-mypy
61-
rev: v1.2.0
59+
rev: v1.3.0
6260
hooks:
6361
- id: mypy
6462
files: ^(src/|testing/)

AUTHORS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@ Abdeali JK
88
Abdelrahman Elbehery
99
Abhijeet Kasurde
1010
Adam Johnson
11+
Adam Stewart
1112
Adam Uhlir
1213
Ahn Ki-Wook
1314
Akiomi Kamakura
1415
Alan Velasco
1516
Alessio Izzo
17+
Alex Jones
18+
Alex Lambson
1619
Alexander Johnson
1720
Alexander King
1821
Alexei Kozlenok
@@ -55,6 +58,7 @@ Benjamin Peterson
5558
Bernard Pratz
5659
Bob Ippolito
5760
Brian Dorsey
61+
Brian Larsen
5862
Brian Maissy
5963
Brian Okken
6064
Brianna Laugher
@@ -304,6 +308,7 @@ Rafal Semik
304308
Raquel Alegre
305309
Ravi Chandra
306310
Robert Holt
311+
Roberto Aldera
307312
Roberto Polli
308313
Roland Puntaier
309314
Romain Dorgueil

changelog/10169.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix bug where very long option names could cause pytest to break with ``OSError: [Errno 36] File name too long`` on some systems.

changelog/10831.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Terminal Reporting: Fixed bug when running in ``--tb=line`` mode where ``pytest.fail(pytrace=False)`` tests report ``None``.

changelog/10872.improvement.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update test log report annotation to named tuple and fixed inconsistency in docs for :hook:`pytest_report_teststatus` hook.

changelog/10901.feature.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Added :func:`ExceptionInfo.from_exception() <pytest.ExceptionInfo.from_exception>`, a simpler way to create an :class:`~pytest.ExceptionInfo` from an exception.
2+
This can replace :func:`ExceptionInfo.from_exc_info() <pytest.ExceptionInfo.from_exc_info()>` for most uses.

changelog/10907.improvement.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
When an exception traceback to be displayed is completely filtered out (by mechanisms such as ``__tracebackhide__``, internal frames, and similar), now only the exception string and the following message are shown:
2+
3+
"All traceback entries are hidden. Pass `--full-trace` to see hidden and internal frames.".
4+
5+
Previously, the last frame of the traceback was shown, even though it was hidden.

changelog/10940.improvement.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Improved verbose output (``-vv``) of ``skip`` and ``xfail`` reasons by performing text wrapping while leaving a clear margin for progress output.
2+
3+
Added :func:`TerminalReporter.wrap_write() <pytest.TerminalReporter.wrap_write>` as a helper for that.

changelog/10987.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
:confval:`testpaths` is now honored to load root ``conftests``.

changelog/10999.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The `monkeypatch` `setitem`/`delitem` type annotations now allow `TypedDict` arguments.

changelog/11005.improvement.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added underlying exception to cache provider path creation and write warning messages.

changelog/8711.improvement.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
:func:`_pytest.logging.LogCaptureFixture.set_level` and :func:`_pytest.logging.LogCaptureFixture.at_level`
2+
will temporarily enable the requested ``level`` if ``level`` was disabled globally via
3+
``logging.disable(LEVEL)``.

doc/en/announce/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Release announcements
66
:maxdepth: 2
77

88

9+
release-7.3.1
910
release-7.3.0
1011
release-7.2.2
1112
release-7.2.1

doc/en/announce/release-7.3.1.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
pytest-7.3.1
2+
=======================================
3+
4+
pytest 7.3.1 has just been released to PyPI.
5+
6+
This is a bug-fix release, being a drop-in replacement. To upgrade::
7+
8+
pip install --upgrade pytest
9+
10+
The full changelog is available at https://docs.pytest.org/en/stable/changelog.html.
11+
12+
Thanks to all of the contributors to this release:
13+
14+
* Ran Benita
15+
16+
17+
Happy testing,
18+
The pytest Development Team

doc/en/backwards-compatibility.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,5 @@ pytest version min. Python version
9292
5.0 - 6.1 3.5+
9393
3.3 - 4.6 2.7, 3.4+
9494
============== ===================
95+
96+
`Status of Python Versions <https://devguide.python.org/versions/>`__.

doc/en/changelog.rst

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,29 @@ with advance notice in the **Deprecations** section of releases.
2828

2929
.. towncrier release notes start
3030
31+
pytest 7.3.1 (2023-04-14)
32+
=========================
33+
34+
Improvements
35+
------------
36+
37+
- `#10875 <https://github.com/pytest-dev/pytest/issues/10875>`_: Python 3.12 support: fixed ``RuntimeError: TestResult has no addDuration method`` when running ``unittest`` tests.
38+
39+
40+
- `#10890 <https://github.com/pytest-dev/pytest/issues/10890>`_: Python 3.12 support: fixed ``shutil.rmtree(onerror=...)`` deprecation warning when using :fixture:`tmp_path`.
41+
42+
43+
44+
Bug Fixes
45+
---------
46+
47+
- `#10896 <https://github.com/pytest-dev/pytest/issues/10896>`_: Fixed performance regression related to :fixture:`tmp_path` and the new :confval:`tmp_path_retention_policy` option.
48+
49+
50+
- `#10903 <https://github.com/pytest-dev/pytest/issues/10903>`_: Fix crash ``INTERNALERROR IndexError: list index out of range`` which happens when displaying an exception where all entries are hidden.
51+
This reverts the change "Correctly handle ``__tracebackhide__`` for chained exceptions." introduced in version 7.3.0.
52+
53+
3154
pytest 7.3.0 (2023-04-08)
3255
=========================
3356

@@ -82,6 +105,7 @@ Bug Fixes
82105

83106

84107
- `#1904 <https://github.com/pytest-dev/pytest/issues/1904>`_: Correctly handle ``__tracebackhide__`` for chained exceptions.
108+
NOTE: This change was reverted in version 7.3.1.
85109

86110

87111

@@ -543,7 +567,7 @@ Breaking Changes
543567
- `#7259 <https://github.com/pytest-dev/pytest/issues/7259>`_: The :ref:`Node.reportinfo() <non-python tests>` function first return value type has been expanded from `py.path.local | str` to `os.PathLike[str] | str`.
544568

545569
Most plugins which refer to `reportinfo()` only define it as part of a custom :class:`pytest.Item` implementation.
546-
Since `py.path.local` is a `os.PathLike[str]`, these plugins are unaffacted.
570+
Since `py.path.local` is an `os.PathLike[str]`, these plugins are unaffacted.
547571

548572
Plugins and users which call `reportinfo()`, use the first return value and interact with it as a `py.path.local`, would need to adjust by calling `py.path.local(fspath)`.
549573
Although preferably, avoid the legacy `py.path.local` and use `pathlib.Path`, or use `item.location` or `item.path`, instead.
@@ -4043,7 +4067,7 @@ Removals
40434067
See our :ref:`docs <calling fixtures directly deprecated>` on information on how to update your code.
40444068

40454069

4046-
- :issue:`4546`: Remove ``Node.get_marker(name)`` the return value was not usable for more than a existence check.
4070+
- :issue:`4546`: Remove ``Node.get_marker(name)`` the return value was not usable for more than an existence check.
40474071

40484072
Use ``Node.get_closest_marker(name)`` as a replacement.
40494073

doc/en/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@
341341
# The scheme of the identifier. Typical schemes are ISBN or URL.
342342
# epub_scheme = ''
343343

344-
# The unique identifier of the text. This can be a ISBN number
344+
# The unique identifier of the text. This can be an ISBN number
345345
# or the project homepage.
346346
# epub_identifier = ''
347347

doc/en/explanation/goodpractices.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,3 +294,20 @@ See also `pypa/setuptools#1684 <https://github.com/pypa/setuptools/issues/1684>`
294294

295295
setuptools intends to
296296
`remove the test command <https://github.com/pypa/setuptools/issues/931>`_.
297+
298+
Checking with flake8-pytest-style
299+
---------------------------------
300+
301+
In order to ensure that pytest is being used correctly in your project,
302+
it can be helpful to use the `flake8-pytest-style <https://github.com/m-burst/flake8-pytest-style>`_ flake8 plugin.
303+
304+
flake8-pytest-style checks for common mistakes and coding style violations in pytest code,
305+
such as incorrect use of fixtures, test function names, and markers.
306+
By using this plugin, you can catch these errors early in the development process
307+
and ensure that your pytest code is consistent and easy to maintain.
308+
309+
A list of the lints detected by flake8-pytest-style can be found on its `PyPI page <https://pypi.org/project/flake8-pytest-style/>`_.
310+
311+
.. note::
312+
313+
flake8-pytest-style is not an official pytest project. Some of the rules enforce certain style choices, such as using `@pytest.fixture()` over `@pytest.fixture`, but you can configure the plugin to fit your preferred style.

doc/en/getting-started.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Install ``pytest``
2222
.. code-block:: bash
2323
2424
$ pytest --version
25-
pytest 7.3.0
25+
pytest 7.3.1
2626
2727
.. _`simpletest`:
2828

doc/en/how-to/usage.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,12 @@ Pytest supports several ways to run and select tests from the command-line.
3535

3636
.. code-block:: bash
3737
38-
pytest -k "MyClass and not method"
38+
pytest -k 'MyClass and not method'
3939
4040
This will run tests which contain names that match the given *string expression* (case-insensitive),
4141
which can include Python operators that use filenames, class names and function names as variables.
4242
The example above will run ``TestMyClass.test_something`` but not ``TestMyClass.test_method_simple``.
43+
Use ``""`` instead of ``''`` in expression when running this on Windows
4344

4445
.. _nodeids:
4546

doc/en/index.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
:orphan:
22

3-
..
4-
.. sidebar:: Next Open Trainings
3+
.. sidebar:: Next Open Trainings
54

6-
- `Professional Testing with Python <https://python-academy.com/courses/python_course_testing.html>`_, via `Python Academy <https://www.python-academy.com/>`_, March 7th to 9th 2023 (3 day in-depth training), Remote
5+
- `Professional Testing with Python <https://python-academy.com/courses/python_course_testing.html>`_, via `Python Academy <https://www.python-academy.com/>`_, March 5th to 7th 2024 (3 day in-depth training), Leipzig/Remote
76

8-
Also see :doc:`previous talks and blogposts <talks>`.
7+
Also see :doc:`previous talks and blogposts <talks>`.
98

109
.. _features:
1110

0 commit comments

Comments
 (0)