From 580c4bea8e9685918e83c71d5dfaa40c0f313ba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Thu, 28 May 2026 17:08:27 -0700 Subject: [PATCH] python3Packages.redis: add passthru.tests --- .../python-modules/redis/default.nix | 48 ++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/redis/default.nix b/pkgs/development/python-modules/redis/default.nix index 24a401f4e3f6..801be1ce99c8 100644 --- a/pkgs/development/python-modules/redis/default.nix +++ b/pkgs/development/python-modules/redis/default.nix @@ -31,6 +31,12 @@ # extras: xxhash xxhash, + + # tests + numpy, + pytest-asyncio, + pytestCheckHook, + redisTestHook, }: buildPythonPackage (finalAttrs: { @@ -78,9 +84,49 @@ buildPythonPackage (finalAttrs: { "redis.utils" ]; - # Tests require a running redis + nativeCheckInputs = [ + numpy + pytest-asyncio + pytestCheckHook + redisTestHook + ] + ++ finalAttrs.passthru.optional-dependencies.circuit_breaker + ++ finalAttrs.passthru.optional-dependencies.otel; + + enabledTestMarks = [ + "onlynoncluster" + ]; + + disabledTestMarks = [ + "onlycluster" + "redismod" + ]; + + disabledTestPaths = [ + # requires Redis Sentinel + "tests/test_asyncio/test_sentinel.py" + "tests/test_sentinel.py" + # FIXME package redis-entraid + "tests/test_asyncio/test_credentials.py" + "tests/test_credentials.py" + ]; + + disabledTests = [ + # requires a Redis cluster + "test_readonly_invalid_cluster_state" + # we run Valkey, not Redis + "test_lolwut" + ]; + + # circular dependency via pybreaker doCheck = false; + passthru.tests = { + pytest = finalAttrs.finalPackage.overrideAttrs { + doInstallCheck = true; + }; + }; + meta = { description = "Python client for Redis key-value store"; homepage = "https://github.com/redis/redis-py";