Skip to content

Commit b6d97c1

Browse files
authored
Merge branch 'main' into pytest_skip_paramspec
2 parents 58892a3 + 1d59ddf commit b6d97c1

19 files changed

Lines changed: 128 additions & 52 deletions

.github/workflows/test.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ jobs:
118118
os: windows-latest
119119
tox_env: "py313"
120120

121+
- name: "windows-py314"
122+
python: "3.14"
123+
os: windows-latest
124+
tox_env: "py314"
121125

122126
- name: "ubuntu-py39-lsof-numpy-pexpect"
123127
python: "3.9"
@@ -163,6 +167,12 @@ jobs:
163167
tox_env: "py313-pexpect"
164168
use_coverage: true
165169

170+
- name: "ubuntu-py314"
171+
python: "3.14"
172+
os: ubuntu-latest
173+
tox_env: "py314"
174+
use_coverage: true
175+
166176
- name: "ubuntu-pypy3-xdist"
167177
python: "pypy-3.9"
168178
os: ubuntu-latest
@@ -190,6 +200,10 @@ jobs:
190200
os: macos-latest
191201
tox_env: "py313-xdist"
192202

203+
- name: "macos-py314"
204+
python: "3.14"
205+
os: macos-latest
206+
tox_env: "py314-xdist"
193207

194208
- name: "plugins"
195209
python: "3.12"
@@ -239,7 +253,8 @@ jobs:
239253
uses: actions/setup-python@v5
240254
with:
241255
python-version: ${{ matrix.python }}
242-
check-latest: ${{ endsWith(matrix.python, '-dev') }}
256+
check-latest: true
257+
allow-prereleases: true
243258

244259
- name: Install dependencies
245260
run: |

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ Nikolay Kondratyev
333333
Nipunn Koorapati
334334
Oleg Pidsadnyi
335335
Oleg Sushchenko
336+
Oleksandr Zavertniev
336337
Olga Matoula
337338
Oliver Bestwalter
338339
Omar Kohl

CONTRIBUTING.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,8 @@ The objectives of the ``pytest-dev`` organisation are:
139139
* Sharing some of the maintenance responsibility (in case a maintainer no
140140
longer wishes to maintain a plugin)
141141

142-
You can submit your plugin by subscribing to the `pytest-dev mail list
143-
<https://mail.python.org/mailman/listinfo/pytest-dev>`_ and writing a
144-
mail pointing to your existing pytest plugin repository which must have
142+
You can submit your plugin by posting a new topic in the `pytest-dev GitHub Discussions
143+
<https://github.com/pytest-dev/pytest/discussions>`_ pointing to your existing pytest plugin repository which must have
145144
the following:
146145

147146
- PyPI presence with packaging metadata that contains a ``pytest-``

changelog/13308.improvement.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added official support for Python 3.14.

changelog/13312.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed a possible ``KeyError`` crash on PyPy during collection of tests involving higher-scoped parameters.

changelog/13420.improvement.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improved test collection performance by optimizing path resolution used in ``FSCollector``.

doc/en/contact.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ Mail
3535
----
3636

3737
- `Testing In Python`_: a mailing list for Python testing tools and discussion.
38-
- `pytest-dev at python.org`_ a mailing list for pytest specific announcements and discussions.
3938
- Mail to `core@pytest.org <mailto:core@pytest.org>`_ for topics that cannot be
4039
discussed in public. Mails sent there will be distributed among the members
4140
in the pytest core team, who can also be contacted individually:
@@ -58,4 +57,3 @@ Other
5857
.. _`pytest issue tracker`: https://github.com/pytest-dev/pytest/issues
5958
.. _`pytest discussions`: https://github.com/pytest-dev/pytest/discussions
6059
.. _`Testing in Python`: http://lists.idyll.org/listinfo/testing-in-python
61-
.. _`pytest-dev at python.org`: http://mail.python.org/mailman/listinfo/pytest-dev

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ classifiers = [
3838
"Programming Language :: Python :: 3.11",
3939
"Programming Language :: Python :: 3.12",
4040
"Programming Language :: Python :: 3.13",
41+
"Programming Language :: Python :: 3.14",
4142
"Topic :: Software Development :: Libraries",
4243
"Topic :: Software Development :: Testing",
4344
"Topic :: Utilities",
@@ -349,7 +350,7 @@ ignore = "W009"
349350

350351
[tool.pyproject-fmt]
351352
indent = 4
352-
max_supported_python = "3.13"
353+
max_supported_python = "3.14"
353354

354355
[tool.pytest.ini_options]
355356
minversion = "2.0"

src/_pytest/fixtures.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,10 +286,18 @@ def reorder_items_atscope(
286286
for other_scope in HIGH_SCOPES:
287287
other_scoped_items_by_argkey = items_by_argkey[other_scope]
288288
for argkey in argkeys_by_item[other_scope].get(i, ()):
289-
other_scoped_items_by_argkey[argkey][i] = None
290-
other_scoped_items_by_argkey[argkey].move_to_end(
291-
i, last=False
292-
)
289+
argkey_dict = other_scoped_items_by_argkey[argkey]
290+
if not hasattr(sys, "pypy_version_info"):
291+
argkey_dict[i] = None
292+
argkey_dict.move_to_end(i, last=False)
293+
else:
294+
# Work around a bug in PyPy:
295+
# https://github.com/pypy/pypy/issues/5257
296+
# https://github.com/pytest-dev/pytest/issues/13312
297+
bkp = argkey_dict.copy()
298+
argkey_dict.clear()
299+
argkey_dict[i] = None
300+
argkey_dict.update(bkp)
293301
break
294302
if no_argkey_items:
295303
reordered_no_argkey_items = reorder_items_atscope(

src/_pytest/nodes.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
from _pytest.mark.structures import NodeKeywords
3939
from _pytest.outcomes import fail
4040
from _pytest.pathlib import absolutepath
41-
from _pytest.pathlib import commonpath
4241
from _pytest.stash import Stash
4342
from _pytest.warning_types import PytestWarning
4443

@@ -548,10 +547,13 @@ def _traceback_filter(self, excinfo: ExceptionInfo[BaseException]) -> Traceback:
548547
def _check_initialpaths_for_relpath(
549548
initial_paths: frozenset[Path], path: Path
550549
) -> str | None:
551-
for initial_path in initial_paths:
552-
if commonpath(path, initial_path) == initial_path:
553-
rel = str(path.relative_to(initial_path))
554-
return "" if rel == "." else rel
550+
if path in initial_paths:
551+
return ""
552+
553+
for parent in path.parents:
554+
if parent in initial_paths:
555+
return str(path.relative_to(parent))
556+
555557
return None
556558

557559

0 commit comments

Comments
 (0)