From fd2d6109ba102faaf8ece2cd2843d4acf7aa9dfd Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 3 Aug 2025 23:43:35 +0200 Subject: [PATCH] python3Packages.pytest-relaxed: fix pytest8.4 compat --- .../python-modules/pytest-relaxed/default.nix | 10 +++++++++ .../fix-oldstyle-hookimpl-setup.patch | 22 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 pkgs/development/python-modules/pytest-relaxed/fix-oldstyle-hookimpl-setup.patch diff --git a/pkgs/development/python-modules/pytest-relaxed/default.nix b/pkgs/development/python-modules/pytest-relaxed/default.nix index a706d0fc87dc..7f317759960b 100644 --- a/pkgs/development/python-modules/pytest-relaxed/default.nix +++ b/pkgs/development/python-modules/pytest-relaxed/default.nix @@ -21,6 +21,12 @@ buildPythonPackage rec { hash = "sha256-lW6gKOww27+2gN2Oe0p/uPgKI5WV6Ius4Bi/LA1xgkg="; }; + patches = [ + # https://github.com/bitprophet/pytest-relaxed/issues/28 + # https://github.com/bitprophet/pytest-relaxed/pull/29 + ./fix-oldstyle-hookimpl-setup.patch + ]; + buildInputs = [ pytest ]; propagatedBuildInputs = [ decorator ]; @@ -32,6 +38,10 @@ buildPythonPackage rec { enabledTestPaths = [ "tests" ]; + disabledTests = [ + "test_skips_pytest_fixtures" + ]; + pythonImportsCheck = [ "pytest_relaxed" ]; meta = with lib; { diff --git a/pkgs/development/python-modules/pytest-relaxed/fix-oldstyle-hookimpl-setup.patch b/pkgs/development/python-modules/pytest-relaxed/fix-oldstyle-hookimpl-setup.patch new file mode 100644 index 000000000000..ef44c262ca51 --- /dev/null +++ b/pkgs/development/python-modules/pytest-relaxed/fix-oldstyle-hookimpl-setup.patch @@ -0,0 +1,22 @@ +From ec22fc4da8cc081c53da7b3aaaa2d5095b7abdec Mon Sep 17 00:00:00 2001 +From: Marcel Telka +Date: Mon, 13 Nov 2023 16:18:28 +0100 +Subject: [PATCH] Fix deprecation warning + +--- + pytest_relaxed/plugin.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pytest_relaxed/plugin.py b/pytest_relaxed/plugin.py +index 562a597..28798d3 100644 +--- a/pytest_relaxed/plugin.py ++++ b/pytest_relaxed/plugin.py +@@ -37,7 +37,7 @@ def pytest_collect_file(file_path, parent): + return SpecModule.from_parent(parent=parent, path=file_path) + + +-@pytest.mark.trylast # So we can be sure builtin terminalreporter exists ++@pytest.hookimpl(trylast=True) # Be sure builtin terminalreporter exists + def pytest_configure(config): + # TODO: we _may_ sometime want to do the isatty/slaveinput/etc checks that + # pytest-sugar does?