summary refs log tree commit diff
path: root/pkgs/development/python-modules/hug
diff options
context:
space:
mode:
authorRobert Scott <code@humanleg.org.uk>2019-09-14 13:56:53 +0100
committerRobert Scott <code@humanleg.org.uk>2019-09-14 15:16:00 +0100
commitd7cad2b8f9a4d3c7ec89c3fb19d1b2c685e536ec (patch)
treebe1ee95116f029daee9a7274f5e9a3f662cc689e /pkgs/development/python-modules/hug
parentdd57bf928b153236fa41c5cb214c912683936f9a (diff)
downloadnixpkgs-d7cad2b8f9a4d3c7ec89c3fb19d1b2c685e536ec.tar
nixpkgs-d7cad2b8f9a4d3c7ec89c3fb19d1b2c685e536ec.tar.gz
nixpkgs-d7cad2b8f9a4d3c7ec89c3fb19d1b2c685e536ec.tar.bz2
nixpkgs-d7cad2b8f9a4d3c7ec89c3fb19d1b2c685e536ec.tar.lz
nixpkgs-d7cad2b8f9a4d3c7ec89c3fb19d1b2c685e536ec.tar.xz
nixpkgs-d7cad2b8f9a4d3c7ec89c3fb19d1b2c685e536ec.tar.zst
nixpkgs-d7cad2b8f9a4d3c7ec89c3fb19d1b2c685e536ec.zip
pythonPackages.hug: enable tests
Diffstat (limited to 'pkgs/development/python-modules/hug')
-rw-r--r--pkgs/development/python-modules/hug/default.nix22
1 files changed, 16 insertions, 6 deletions
diff --git a/pkgs/development/python-modules/hug/default.nix b/pkgs/development/python-modules/hug/default.nix
index 5638447bceb..bb38c738760 100644
--- a/pkgs/development/python-modules/hug/default.nix
+++ b/pkgs/development/python-modules/hug/default.nix
@@ -1,7 +1,11 @@
-{ lib , buildPythonPackage, fetchPypi, isPy27
+{ lib , buildPythonPackage, fetchFromGitHub, isPy27
 , falcon
 , pytestrunner
 , requests
+, pytest
+, marshmallow
+, mock
+, numpy
 }:
 
 buildPythonPackage rec {
@@ -9,16 +13,22 @@ buildPythonPackage rec {
   version = "2.6.0";
   disabled = isPy27;
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "0iamrzjy8z1xibynkgfl6cn2sbm66awxbp75b26pi32fc41d0k50";
+  src = fetchFromGitHub {
+    owner = "hugapi";
+    repo = pname;
+    rev = version;
+    sha256 = "05rsv16g7ph100p8kl4l2jba0y4wcpp3xblc02mfp67zp1279vaq";
   };
 
   nativeBuildInputs = [ pytestrunner ];
   propagatedBuildInputs = [ falcon requests ];
 
-  # tests are not shipped in the tarball
-  doCheck = false;
+  checkInputs = [ mock marshmallow pytest numpy ];
+  checkPhase = ''
+    mv hug hug.hidden
+    # some tests attempt network access
+    PATH=$out/bin:$PATH pytest -k "not (test_request or test_datagram_request)"
+  '';
 
   meta = with lib; {
     description = "A Python framework that makes developing APIs as simple as possible, but no simpler";