Files
python-pytest-xdist/python-pytest-xdist-3.8.0-fix-for-pytest-9.0+.patch
Keke Ming 9736a00575 add python-pytest-xdist
Signed-off-by: Keke Ming <ming.jvle@gmail.com>
2026-02-25 17:10:33 +08:00

42 lines
1.2 KiB
Diff

From 7f5c9626d838e68ea03cc04e6e5b88986762458c Mon Sep 17 00:00:00 2001
From: Bruno Oliveira <bruno@pytest.org>
Date: Tue, 11 Nov 2025 07:55:54 -0300
Subject: [PATCH] Fix CI for pytest 9.0+
---
testing/test_remote.py | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/testing/test_remote.py b/testing/test_remote.py
index 909f7ca2..ae82e2b7 100644
--- a/testing/test_remote.py
+++ b/testing/test_remote.py
@@ -378,6 +378,11 @@ def test_mainargv(request):
def test_remote_usage_prog(pytester: pytest.Pytester) -> None:
+ if pytest.version_tuple[:2] >= (9, 0):
+ get_optparser_expr = "get_config_parser.optparser"
+ else:
+ get_optparser_expr = "get_config_parser._getparser()"
+
pytester.makeconftest(
"""
import pytest
@@ -394,12 +399,12 @@ def pytest_configure(config):
"""
)
pytester.makepyfile(
- """
+ f"""
import sys
def test(get_config_parser, request):
- get_config_parser._getparser().error("my_usage_error")
- """
+ {get_optparser_expr}.error("my_usage_error")
+ """
)
result = pytester.runpytest_subprocess("-n1")