From cf39280e57d9bc30001ea2446996541c2ea3c7e2 Mon Sep 17 00:00:00 2001 From: Tushar Dalmia Date: Wed, 28 Oct 2026 18:14:52 +0000 Subject: [PATCH] Fix test runs on pytest 9.2 Remove the unused --json_report conftest option, which clashes with pytest-json-report on pytest 9.2. Pin pytest<9.2 because pytest-forked 1.7.5 cannot serialize the new 9.2 report fields. --- conftest.py | 6 ------ pyproject.toml | 4 +++- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/conftest.py b/conftest.py index 2678214..2ef1570 100644 --- a/conftest.py +++ b/conftest.py @@ -198,12 +198,6 @@ def pytest_addoption(parser): dest="ignore_paths", help="Ignore paths during test collection (can be used multiple times)", ) - parser.addoption( - "--json_report", - action="store_true", - default="", - help="Collect distributed tests in upstream pytorch tests", - ) parser.addoption( "--skip-distributed", action="store_true", default=False, help="Skip distributed tests" diff --git a/pyproject.toml b/pyproject.toml index c61fb3f..3e656bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,9 @@ dev = [ "expecttest>=0.3.0", "hypothesis", "ninja>=1.11.1.4", - "pytest", + # pytest-forked 1.7.5 cannot marshal the TestReport._id that pytest 9.2 adds. + # Lift the pin when a pytest-forked release supports pytest 9.2. + "pytest<9.2", "pytest-xdist", "pytest-html", "pytest-cov",