summary refs log tree commit diff
diff options
context:
space:
mode:
authorRobert Scott <code@humanleg.org.uk>2023-01-13 20:19:30 +0000
committerRobert Scott <code@humanleg.org.uk>2023-01-13 20:19:30 +0000
commit5ccffc22c9688c7383ee79eb9b8868621b416fce (patch)
tree1c92f4bf8caccadc7c4b07732ec6b09a0c4ae220
parent760d26e16dc42b02be93d09e33aa74085bf5a720 (diff)
downloadnixpkgs-5ccffc22c9688c7383ee79eb9b8868621b416fce.tar
nixpkgs-5ccffc22c9688c7383ee79eb9b8868621b416fce.tar.gz
nixpkgs-5ccffc22c9688c7383ee79eb9b8868621b416fce.tar.bz2
nixpkgs-5ccffc22c9688c7383ee79eb9b8868621b416fce.tar.lz
nixpkgs-5ccffc22c9688c7383ee79eb9b8868621b416fce.tar.xz
nixpkgs-5ccffc22c9688c7383ee79eb9b8868621b416fce.tar.zst
nixpkgs-5ccffc22c9688c7383ee79eb9b8868621b416fce.zip
python3Packages.graphite-web: enable tests
-rw-r--r--pkgs/development/python-modules/graphite-web/default.nix19
1 files changed, 19 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/graphite-web/default.nix b/pkgs/development/python-modules/graphite-web/default.nix
index 63ddd906e16..a82f9982cb3 100644
--- a/pkgs/development/python-modules/graphite-web/default.nix
+++ b/pkgs/development/python-modules/graphite-web/default.nix
@@ -1,12 +1,14 @@
 { lib
 , stdenv
 , buildPythonPackage
+, python
 , cairocffi
 , django
 , django_tagging
 , fetchFromGitHub
 , fetchpatch
 , gunicorn
+, mock
 , pyparsing
 , python-memcached
 , pythonOlder
@@ -73,6 +75,23 @@ buildPythonPackage rec {
       --replace "join(WEBAPP_DIR, 'content')" "join('$out', 'webapp', 'content')"
   '';
 
+  checkInputs = [ mock ];
+  checkPhase = ''
+    runHook preCheck
+
+    pushd webapp/
+    # avoid confusion with installed module
+    rm -r graphite
+    # redis not practical in test environment
+    substituteInPlace tests/test_tags.py \
+      --replace test_redis_tagdb _dont_test_redis_tagdb
+
+    DJANGO_SETTINGS_MODULE=tests.settings ${python.interpreter} manage.py test
+    popd
+
+    runHook postCheck
+  '';
+
   pythonImportsCheck = [
     "graphite"
   ];