From 1c44a8ef547f821da4f4e8d4f7df1cd99105fe1f Mon Sep 17 00:00:00 2001 From: Martin Joerg Date: Wed, 25 Feb 2026 09:54:16 +0000 Subject: [PATCH] python3Packages.python-keycloak: enable checks --- .../python-keycloak/default.nix | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/python-keycloak/default.nix b/pkgs/development/python-modules/python-keycloak/default.nix index 7ce0c93f129e..c41d940ea046 100644 --- a/pkgs/development/python-modules/python-keycloak/default.nix +++ b/pkgs/development/python-modules/python-keycloak/default.nix @@ -9,6 +9,9 @@ poetry-core, requests, requests-toolbelt, + freezegun, + pytest-asyncio, + pytestCheckHook, }: buildPythonPackage (finalAttrs: { @@ -40,8 +43,26 @@ buildPythonPackage (finalAttrs: { requests-toolbelt ]; - # Test fixtures require a running keycloak instance - doCheck = false; + nativeCheckInputs = [ + freezegun + pytest-asyncio + pytestCheckHook + ]; + + # conftest.py requires these variables to be set, + # even if the respective tests are disabled + preCheck = '' + export KEYCLOAK_{HOST,PORT,ADMIN{,_PASSWORD}}= + ''; + + disabledTestPaths = [ + # these tests require a running keycloak instance + "tests/test_keycloak_openid.py" + "tests/test_keycloak_admin.py" + "tests/test_keycloak_uma.py" + # requires docker + "tests/test_pkce_flow.py" + ]; pythonImportsCheck = [ "keycloak" ];