summary refs log tree commit diff
diff options
context:
space:
mode:
authorDrew Risinger <drewrisinger@users.noreply.github.com>2020-09-17 10:54:32 -0400
committerJonathan Ringer <jonringer117@gmail.com>2020-11-05 15:47:09 -0800
commit1849bc57be30a3c8c9ca8b520950208a1f5f1daf (patch)
tree0c0c70129820e82a712527ba784b3c4c0719df75
parentac8aff99bf4aea5d641dd2b23afb228d3cfa458b (diff)
downloadnixpkgs-1849bc57be30a3c8c9ca8b520950208a1f5f1daf.tar
nixpkgs-1849bc57be30a3c8c9ca8b520950208a1f5f1daf.tar.gz
nixpkgs-1849bc57be30a3c8c9ca8b520950208a1f5f1daf.tar.bz2
nixpkgs-1849bc57be30a3c8c9ca8b520950208a1f5f1daf.tar.lz
nixpkgs-1849bc57be30a3c8c9ca8b520950208a1f5f1daf.tar.xz
nixpkgs-1849bc57be30a3c8c9ca8b520950208a1f5f1daf.tar.zst
nixpkgs-1849bc57be30a3c8c9ca8b520950208a1f5f1daf.zip
pythonPackages.pandas: convert to pytestCheckHook
-rw-r--r--pkgs/development/python-modules/pandas/default.nix25
1 files changed, 13 insertions, 12 deletions
diff --git a/pkgs/development/python-modules/pandas/default.nix b/pkgs/development/python-modules/pandas/default.nix
index da3358cbbda..ce208fe9078 100644
--- a/pkgs/development/python-modules/pandas/default.nix
+++ b/pkgs/development/python-modules/pandas/default.nix
@@ -21,7 +21,7 @@
 , glibcLocales
 , hypothesis
 , moto
-, pytest
+, pytestCheckHook
 # Darwin inputs
 , runtimeShell
 , libcxx ? null
@@ -40,8 +40,6 @@ in buildPythonPackage rec {
     sha256 = "a979d0404b135c63954dea79e6246c45dd45371a88631cdbb4877d844e6de3b6";
   };
 
-  checkInputs = [ pytest glibcLocales moto hypothesis ];
-
   nativeBuildInputs = [ cython ];
   buildInputs = optional isDarwin libcxx;
   propagatedBuildInputs = [
@@ -60,6 +58,8 @@ in buildPythonPackage rec {
     xlwt
   ];
 
+  checkInputs = [ pytestCheckHook glibcLocales moto hypothesis ];
+
   # doesn't work with -Werror,-Wunused-command-line-argument
   # https://github.com/NixOS/nixpkgs/issues/39687
   hardeningDisable = optional stdenv.cc.isClang "strictoverflow";
@@ -82,8 +82,14 @@ in buildPythonPackage rec {
     "--parallel=$NIX_BUILD_CORES"
   ];
 
+  doCheck = !stdenv.isAarch64; # upstream doesn't test this architecture
 
-  disabledTests = stdenv.lib.concatMapStringsSep " and " (s: "not " + s) ([
+  pytestFlagsArray = [
+    "$out/${python.sitePackages}/pandas"
+    "--skip-slow"
+    "--skip-network"
+  ];
+  disabledTests = [
     # since dateutil 0.6.0 the following fails: test_fallback_plural, test_ambiguous_flags, test_ambiguous_compat
     # was supposed to be solved by https://github.com/dateutil/dateutil/issues/321, but is not the case
     "test_fallback_plural"
@@ -110,12 +116,10 @@ in buildPythonPackage rec {
   ] ++ optionals isDarwin [
     "test_locale"
     "test_clipboard"
-  ]);
-
-  doCheck = !stdenv.isAarch64; # upstream doesn't test this architecture
+  ];
 
-  checkPhase = ''
-    runHook preCheck
+  preCheck = ''
+    export LC_ALL="en_US.UTF-8"
   ''
   # TODO: Get locale and clipboard support working on darwin.
   #       Until then we disable the tests.
@@ -125,9 +129,6 @@ in buildPythonPackage rec {
     echo "#!${runtimeShell}" > pbpaste
     chmod a+x pbcopy pbpaste
     export PATH=$(pwd):$PATH
-  '' + ''
-    LC_ALL="en_US.UTF-8" py.test $out/${python.sitePackages}/pandas --skip-slow --skip-network -k "$disabledTests"
-    runHook postCheck
   '';
 
   meta = with stdenv.lib; {