From 9ef783d06da93f05afddb3a8df41fcb1987b5cfb Mon Sep 17 00:00:00 2001 From: K900 Date: Sat, 23 Aug 2025 10:40:49 +0300 Subject: [PATCH] python313Packages.django-cachalot: actually use pytestCheckHook, skip broken tests --- .../django-cachalot/default.nix | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/django-cachalot/default.nix b/pkgs/development/python-modules/django-cachalot/default.nix index 7d8377e74039..37e126c50621 100644 --- a/pkgs/development/python-modules/django-cachalot/default.nix +++ b/pkgs/development/python-modules/django-cachalot/default.nix @@ -56,19 +56,23 @@ buildPythonPackage rec { # redisTestHook does not work on darwin doCheck = !stdenv.hostPlatform.isDarwin; - # disable broken pinning test preCheck = '' - substituteInPlace cachalot/tests/read.py \ - --replace-fail \ - "def test_explain(" \ - "def _test_explain(" + export DJANGO_SETTINGS_MODULE=settings ''; - checkPhase = '' - runHook preCheck - ${python.interpreter} runtests.py - runHook postCheck - ''; + pytestFlags = [ + "-o python_files=*.py" + "-o collect_imported_tests=false" + "cachalot/tests" + "cachalot/admin_tests" + ]; + + disabledTests = [ + # relies on specific EXPLAIN output format from sqlite, which is not stable + "test_explain" + # broken on django-debug-toolbar 6.0 + "test_rendering" + ]; meta = with lib; { description = "No effort, no worry, maximum performance";