Skip to content

Commit c81662c

Browse files
committed
Merge branch 'main' into re-emit
2 parents ca61b80 + 797b924 commit c81662c

Some content is hidden

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

71 files changed

+1719
-594
lines changed

.github/workflows/stale.yml

+23
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

.github/workflows/test.yml

+20-8
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
"windows-py39",
4444
"windows-py310",
4545
"windows-py311",
46+
"windows-py312",
4647

4748
"ubuntu-py37",
4849
"ubuntu-py37-pluggy",
@@ -51,12 +52,13 @@ jobs:
5152
"ubuntu-py39",
5253
"ubuntu-py310",
5354
"ubuntu-py311",
55+
"ubuntu-py312",
5456
"ubuntu-pypy3",
5557

5658
"macos-py37",
57-
"macos-py38",
5859
"macos-py39",
5960
"macos-py310",
61+
"macos-py312",
6062

6163
"docs",
6264
"doctesting",
@@ -86,9 +88,13 @@ jobs:
8688
os: windows-latest
8789
tox_env: "py310-xdist"
8890
- name: "windows-py311"
89-
python: "3.11-dev"
91+
python: "3.11"
9092
os: windows-latest
9193
tox_env: "py311"
94+
- name: "windows-py312"
95+
python: "3.12-dev"
96+
os: windows-latest
97+
tox_env: "py312"
9298

9399
- name: "ubuntu-py37"
94100
python: "3.7"
@@ -116,10 +122,15 @@ jobs:
116122
os: ubuntu-latest
117123
tox_env: "py310-xdist"
118124
- name: "ubuntu-py311"
119-
python: "3.11-dev"
125+
python: "3.11"
120126
os: ubuntu-latest
121127
tox_env: "py311"
122128
use_coverage: true
129+
- name: "ubuntu-py312"
130+
python: "3.12-dev"
131+
os: ubuntu-latest
132+
tox_env: "py312"
133+
use_coverage: true
123134
- name: "ubuntu-pypy3"
124135
python: "pypy-3.7"
125136
os: ubuntu-latest
@@ -129,19 +140,19 @@ jobs:
129140
python: "3.7"
130141
os: macos-latest
131142
tox_env: "py37-xdist"
132-
- name: "macos-py38"
133-
python: "3.8"
134-
os: macos-latest
135-
tox_env: "py38-xdist"
136-
use_coverage: true
137143
- name: "macos-py39"
138144
python: "3.9"
139145
os: macos-latest
140146
tox_env: "py39-xdist"
147+
use_coverage: true
141148
- name: "macos-py310"
142149
python: "3.10"
143150
os: macos-latest
144151
tox_env: "py310-xdist"
152+
- name: "macos-py312"
153+
python: "3.12-dev"
154+
os: macos-latest
155+
tox_env: "py312-xdist"
145156

146157
- name: "plugins"
147158
python: "3.9"
@@ -168,6 +179,7 @@ jobs:
168179
uses: actions/setup-python@v4
169180
with:
170181
python-version: ${{ matrix.python }}
182+
check-latest: ${{ endsWith(matrix.python, '-dev') }}
171183

172184
- name: Install dependencies
173185
run: |

.github/workflows/update-plugin-list.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
run: python scripts/update-plugin-list.py
3939

4040
- name: Create Pull Request
41-
uses: peter-evans/create-pull-request@5b4a9f6a9e2af26e5f02351490b90d01eb8ec1e5
41+
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38
4242
with:
4343
commit-message: '[automated] Update plugin list'
4444
author: 'pytest bot <[email protected]>'

.pre-commit-config.yaml

+8-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
default_language_version:
2-
python: "3.10"
31
repos:
42
- repo: https://github.com/psf/black
53
rev: 23.3.0
64
hooks:
75
- id: black
86
args: [--safe, --quiet]
97
- repo: https://github.com/asottile/blacken-docs
10-
rev: 1.13.0
8+
rev: 1.14.0
119
hooks:
1210
- id: blacken-docs
1311
additional_dependencies: [black==23.1.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.1.0
24+
rev: v2.1.1
2725
hooks:
2826
- id: autoflake
2927
name: autoflake
@@ -38,27 +36,27 @@ 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
42-
rev: v3.9.0
39+
- repo: https://github.com/asottile/reorder-python-imports
40+
rev: v3.10.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.7.0
4846
hooks:
4947
- id: pyupgrade
5048
args: [--py37-plus]
5149
- repo: https://github.com/asottile/setup-cfg-fmt
52-
rev: v2.2.0
50+
rev: v2.3.0
5351
hooks:
5452
- id: setup-cfg-fmt
55-
args: ["--max-py-version=3.11", "--include-version-classifiers"]
53+
args: ["--max-py-version=3.12", "--include-version-classifiers"]
5654
- repo: https://github.com/pre-commit/pygrep-hooks
5755
rev: v1.10.0
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

+8
Original file line numberDiff line numberDiff line change
@@ -8,12 +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
1617
Alex Jones
18+
Alex Lambson
1719
Alexander Johnson
1820
Alexander King
1921
Alexei Kozlenok
@@ -56,6 +58,7 @@ Benjamin Peterson
5658
Bernard Pratz
5759
Bob Ippolito
5860
Brian Dorsey
61+
Brian Larsen
5962
Brian Maissy
6063
Brian Okken
6164
Brianna Laugher
@@ -69,6 +72,7 @@ Charles Cloud
6972
Charles Machalow
7073
Charnjit SiNGH (CCSJ)
7174
Cheuk Ting Ho
75+
Chris Mahoney
7276
Chris Lamb
7377
Chris NeJame
7478
Chris Rose
@@ -127,6 +131,7 @@ Eric Siegerman
127131
Erik Aronesty
128132
Erik M. Bray
129133
Evan Kepner
134+
Evgeny Seliverstov
130135
Fabien Zarifian
131136
Fabio Zadrozny
132137
Felix Hofstätter
@@ -193,6 +198,7 @@ Justice Ndou
193198
Justyna Janczyszyn
194199
Kale Kundert
195200
Kamran Ahmad
201+
Kenny Y
196202
Karl O. Pinc
197203
Karthikeyan Singaravelan
198204
Katarzyna Jachim
@@ -305,6 +311,7 @@ Rafal Semik
305311
Raquel Alegre
306312
Ravi Chandra
307313
Robert Holt
314+
Roberto Aldera
308315
Roberto Polli
309316
Roland Puntaier
310317
Romain Dorgueil
@@ -370,6 +377,7 @@ Victor Maryama
370377
Victor Rodriguez
371378
Victor Uriarte
372379
Vidar T. Fauske
380+
Vijay Arora
373381
Virgil Dupras
374382
Vitaly Lashmanov
375383
Vivaan Verma

changelog/10872.improvement.rst

+1
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/10940.improvement.rst

+3
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/10991.improvement.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added handling of ``%f`` directive to print microseconds in log format options, such as ``log-date-format``.

changelog/11005.improvement.rst

+1
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/11013.improvement.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added warning when :confval:`testpaths` is set, but paths are not found by glob. In this case, pytest will fall back to searching from the current directory.

changelog/11031.trivial.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Enhanced the CLI flag for ``-c`` to now include ``--config-file`` to make it clear that this flag applies to the usage of a custom config file.

changelog/11043.improvement.rst

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
When `--confcutdir` is not specified, and there is no config file present, the conftest cutoff directory (`--confcutdir`) is now set to the :ref:`rootdir`.
2+
Previously in such cases, `conftest.py` files would be probed all the way to the root directory of the filesystem.
3+
If you are badly affected by this change, consider adding an empty config file to your desired cutoff directory, or explicitly set `--confcutdir`.

changelog/11068.bugfix.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed the ``--last-failed`` whole-file skipping functionality ("skipped N files") for :ref:`non-python test files <non-python tests>`.

changelog/11081.improvement.rst

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
The :confval:`norecursedir` check is now performed in a :hook:`pytest_ignore_collect` implementation, so plugins can affect it.
2+
3+
If after updating to this version you see that your `norecursedir` setting is not being respected,
4+
it means that a conftest or a plugin you use has a bad `pytest_ignore_collect` implementation.
5+
Most likely, your hook returns `False` for paths it does not want to ignore,
6+
which ends the processing and doesn't allow other plugins, including pytest itself, to ignore the path.
7+
The fix is to return `None` instead of `False` for paths your hook doesn't want to ignore.

changelog/1904.bugfix.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed traceback entries hidden with ``__tracebackhide__ = True`` still being shown for chained exceptions (parts after "... the above exception ..." message).

changelog/8711.improvement.rst

+3
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)``.

changelog/9146.doc.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improve Documentation for `caplog.set_level`.

doc/en/announce/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Release announcements
66
:maxdepth: 2
77

88

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

doc/en/announce/release-7.3.2.rst

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
pytest-7.3.2
2+
=======================================
3+
4+
pytest 7.3.2 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+
* Adam J. Stewart
15+
* Alessio Izzo
16+
* Bruno Oliveira
17+
* Ran Benita
18+
19+
20+
Happy testing,
21+
The pytest Development Team

doc/en/backwards-compatibility.rst

+2
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/builtin.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
207207
* caplog.record_tuples -> list of (logger_name, level, message) tuples
208208
* caplog.clear() -> clear captured records and formatted log output string
209209
210-
monkeypatch -- .../_pytest/monkeypatch.py:29
210+
monkeypatch -- .../_pytest/monkeypatch.py:30
211211
A convenient fixture for monkey-patching.
212212
213213
The fixture provides these methods to modify objects, dictionaries, or

doc/en/changelog.rst

+26-2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,30 @@ with advance notice in the **Deprecations** section of releases.
2828

2929
.. towncrier release notes start
3030
31+
pytest 7.3.2 (2023-06-10)
32+
=========================
33+
34+
Bug Fixes
35+
---------
36+
37+
- `#10169 <https://github.com/pytest-dev/pytest/issues/10169>`_: Fix bug where very long option names could cause pytest to break with ``OSError: [Errno 36] File name too long`` on some systems.
38+
39+
40+
- `#10894 <https://github.com/pytest-dev/pytest/issues/10894>`_: Support for Python 3.12 (beta at the time of writing).
41+
42+
43+
- `#10987 <https://github.com/pytest-dev/pytest/issues/10987>`_: :confval:`testpaths` is now honored to load root ``conftests``.
44+
45+
46+
- `#10999 <https://github.com/pytest-dev/pytest/issues/10999>`_: The `monkeypatch` `setitem`/`delitem` type annotations now allow `TypedDict` arguments.
47+
48+
49+
- `#11028 <https://github.com/pytest-dev/pytest/issues/11028>`_: Fixed bug in assertion rewriting where a variable assigned with the walrus operator could not be used later in a function call.
50+
51+
52+
- `#11054 <https://github.com/pytest-dev/pytest/issues/11054>`_: Fixed ``--last-failed``'s "(skipped N files)" functionality for files inside of packages (directories with `__init__.py` files).
53+
54+
3155
pytest 7.3.1 (2023-04-14)
3256
=========================
3357

@@ -567,7 +591,7 @@ Breaking Changes
567591
- `#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`.
568592

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

572596
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)`.
573597
Although preferably, avoid the legacy `py.path.local` and use `pathlib.Path`, or use `item.location` or `item.path`, instead.
@@ -4067,7 +4091,7 @@ Removals
40674091
See our :ref:`docs <calling fixtures directly deprecated>` on information on how to update your code.
40684092

40694093

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

40724096
Use ``Node.get_closest_marker(name)`` as a replacement.
40734097

doc/en/conf.py

+1-1
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/example/nonpython/conftest.py

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def repr_failure(self, excinfo):
3838
" no further details known at this point.",
3939
]
4040
)
41+
return super().repr_failure(excinfo)
4142

4243
def reportinfo(self):
4344
return self.path, 0, f"usecase: {self.name}"

doc/en/example/simple.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ Here is an example for making a ``db`` fixture available in a directory:
691691
pass
692692
693693
694-
@pytest.fixture(scope="session")
694+
@pytest.fixture(scope="package")
695695
def db():
696696
return DB()
697697

0 commit comments

Comments
 (0)