From 0d372ea0417162982e56861bbd5e278c1ba26cde Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 10 Nov 2025 09:55:07 -0500 Subject: [PATCH] try pytest 9 moves reqs to pytest<10 Change-Id: I2b026e1d2803e4e0d29a597e33545fe330422d09 --- noxfile.py | 6 ++++-- pyproject.toml | 4 ++-- tox.ini | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/noxfile.py b/noxfile.py index be7fcff3ae..0c55c3bd0c 100644 --- a/noxfile.py +++ b/noxfile.py @@ -250,7 +250,9 @@ def _tests( if not timing_intensive: includes_excludes["m"].append("not timing_intensive") - cmd = ["python", "-m", "pytest"] + # add test/ argument so that we avoid + # https://github.com/pytest-dev/pytest/issues/13913 + cmd = ["python", "-m", "pytest", "test"] cmd.extend(os.environ.get("TOX_WORKERS", "-n4").split()) @@ -338,7 +340,7 @@ def test_mypy(session: nox.Session) -> None: ["mypy"], ) - cmd = ["pytest", "-m", "mypy"] + cmd = ["pytest", "-m", "mypy", "test"] session.run(*cmd, *posargs) diff --git a/pyproject.toml b/pyproject.toml index c774afea65..c109841cbd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -101,7 +101,7 @@ postgresql_psycopgbinary = ["sqlalchemy[postgresql-psycopgbinary]"] [dependency-groups] tests = [ - "pytest>=7.0.0,<8.4", + "pytest>=7.0.0,<10", "pytest-xdist", ] @@ -191,7 +191,7 @@ mypy = [ {include-group = "tests-greenlet"}, "mypy>=1.16.0", "nox", # because we check noxfile.py - "pytest>8,<8.4", # alembic/testing imports pytest + "pytest>8,<10", # alembic/testing imports pytest "types-greenlet", ] diff --git a/tox.ini b/tox.ini index 9139b5b3aa..a20bf25642 100644 --- a/tox.ini +++ b/tox.ini @@ -66,7 +66,7 @@ deps= # if newer versions will fix the segfault or not mysql: mariadb<1.1.13 - pytest>=7.0.0,<8.4 + pytest>=7.0.0,<10 # tracked by https://github.com/pytest-dev/pytest-xdist/issues/907 pytest-xdist!=3.3.0 @@ -213,7 +213,7 @@ extras = [testenv:mypy] deps= - pytest>=7.0.0rc1,<8.4 + pytest>=7.0.0rc1,<10 pytest-xdist greenlet >= 1 mypy >= 1.17 -- 2.47.3