From bf61433489836f8146e5c36be985523dcc3c60ba Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 13 Jul 2026 13:09:43 +0200 Subject: [PATCH] python3Packages.pytest-cases: 3.9.1 -> 3.10.1 https://github.com/smarie/python-pytest-cases/releases/tag/3.10.1 --- .../python-modules/pytest-cases/default.nix | 10 ++- .../pytest-cases/pytest-9.1-compat.patch | 74 +++++++++++++++++++ 2 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 pkgs/development/python-modules/pytest-cases/pytest-9.1-compat.patch diff --git a/pkgs/development/python-modules/pytest-cases/default.nix b/pkgs/development/python-modules/pytest-cases/default.nix index e5680266e742..b1a0acb72067 100644 --- a/pkgs/development/python-modules/pytest-cases/default.nix +++ b/pkgs/development/python-modules/pytest-cases/default.nix @@ -12,15 +12,21 @@ buildPythonPackage rec { pname = "pytest-cases"; - version = "3.9.1"; + version = "3.10.1"; pyproject = true; src = fetchPypi { pname = "pytest_cases"; inherit version; - hash = "sha256-xOGB8bUlyTGjGNSBL6jeZWwsj7d/zPFXHs8Mxf6Of48="; + hash = "sha256-RR+ePs1dLYGkNiwQxEESb1s9GuOn769Z9gsfuTDfLWk="; }; + patches = [ + # https://github.com/smarie/python-pytest-cases/issues/385 + # https://github.com/smarie/python-pytest-cases/pull/386 + ./pytest-9.1-compat.patch + ]; + build-system = [ setuptools_80 setuptools-scm diff --git a/pkgs/development/python-modules/pytest-cases/pytest-9.1-compat.patch b/pkgs/development/python-modules/pytest-cases/pytest-9.1-compat.patch new file mode 100644 index 000000000000..dfc901cd2452 --- /dev/null +++ b/pkgs/development/python-modules/pytest-cases/pytest-9.1-compat.patch @@ -0,0 +1,74 @@ +From 37c72c1350899d45bc80e92b4b4168b5f7a7af7c Mon Sep 17 00:00:00 2001 +From: "a.berod" +Date: Thu, 9 Jul 2026 10:43:44 +0200 +Subject: [PATCH] Fix compatiblity with pytest 9.1+ + +--- + src/pytest_cases/common_pytest.py | 17 ++++++++++++----- + src/pytest_cases/common_pytest_marks.py | 1 + + 2 files changed, 13 insertions(+), 5 deletions(-) + +diff --git a/src/pytest_cases/common_pytest.py b/src/pytest_cases/common_pytest.py +index afad9d39..4a2b6b71 100644 +--- a/src/pytest_cases/common_pytest.py ++++ b/src/pytest_cases/common_pytest.py +@@ -31,7 +31,7 @@ + from .common_pytest_marks import make_marked_parameter_value, get_param_argnames_as_list, \ + get_pytest_parametrize_marks, get_pytest_usefixture_marks, PYTEST3_OR_GREATER, PYTEST6_OR_GREATER, \ + PYTEST38_OR_GREATER, PYTEST34_OR_GREATER, PYTEST33_OR_GREATER, PYTEST32_OR_GREATER, PYTEST71_OR_GREATER, \ +- PYTEST8_OR_GREATER, PYTEST84_OR_GREATER ++ PYTEST8_OR_GREATER, PYTEST84_OR_GREATER, PYTEST91_OR_GREATER + from .common_pytest_lazy_values import is_lazy_value, is_lazy + + +@@ -641,7 +641,12 @@ def in_callspec_explicit_args( + if PYTEST71_OR_GREATER: + from _pytest.python import IdMaker # noqa + +- _idval = IdMaker([], [], None, None, None, None, None)._idval ++ args = [[], [], None, None, None, None, None] ++ if PYTEST91_OR_GREATER: ++ # func_name removed in https://github.com/pytest-dev/pytest/pull/13976 ++ del args[-1] ++ ++ _idval = IdMaker(*args)._idval + _idval_kwargs = dict() + else: + from _pytest.python import _idval # noqa +@@ -738,10 +743,12 @@ def getfuncargnames(function, cls=None): + + + class FakeSession(object): +- __slots__ = ('_fixturemanager',) ++ __slots__ = ("_fixturemanager", "config", "nodeid") + +- def __init__(self): ++ def __init__(self, nodeid): + self._fixturemanager = None ++ self.config = None ++ self.nodeid = nodeid + + + class MiniFuncDef(object): +@@ -750,7 +757,7 @@ class MiniFuncDef(object): + def __init__(self, nodeid): + self.nodeid = nodeid + if PYTEST8_OR_GREATER: +- self.session = FakeSession() ++ self.session = FakeSession(nodeid=nodeid) + + + class MiniMetafunc(Metafunc): +diff --git a/src/pytest_cases/common_pytest_marks.py b/src/pytest_cases/common_pytest_marks.py +index 6fa33b32..0c6030df 100644 +--- a/src/pytest_cases/common_pytest_marks.py ++++ b/src/pytest_cases/common_pytest_marks.py +@@ -47,6 +47,7 @@ + PYTEST81_OR_GREATER = PYTEST_VERSION >= Version('8.1.0') + PYTEST84_OR_GREATER = PYTEST_VERSION >= Version('8.4.0') + PYTEST9_OR_GREATER = PYTEST_VERSION >= Version('9.0.0') ++PYTEST91_OR_GREATER = PYTEST_VERSION >= Version('9.1.0') + + + def get_param_argnames_as_list(argnames): +