about summary refs log tree commit diff
path: root/pkgs/development/python-modules/cherrypy
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2022-01-11 13:33:57 +0100
committerFabian Affolter <mail@fabian-affolter.ch>2022-01-11 13:33:57 +0100
commitd323f67c004b6b210fd0a5013cca265615317264 (patch)
tree4a8a67cde86aa69b448d8facebd8fb23a6a5fe65 /pkgs/development/python-modules/cherrypy
parent11167fc4f1217f7fb29c1fdcdb696b6d0e70bb49 (diff)
python3Packages.cherrypy: switch to pytestCheckHook
Diffstat (limited to 'pkgs/development/python-modules/cherrypy')
-rw-r--r--pkgs/development/python-modules/cherrypy/default.nix69
1 files changed, 47 insertions, 22 deletions
diff --git a/pkgs/development/python-modules/cherrypy/default.nix b/pkgs/development/python-modules/cherrypy/default.nix
index 3ebebba9ecd10..01bbfe8841b7a 100644
--- a/pkgs/development/python-modules/cherrypy/default.nix
+++ b/pkgs/development/python-modules/cherrypy/default.nix
@@ -1,8 +1,23 @@
-{ lib, stdenv, buildPythonPackage, fetchPypi, pythonOlder
-, setuptools-scm
-, cheroot, portend, more-itertools, zc_lockfile, routes
+{ lib
+, stdenv
+, buildPythonPackage
+, cheroot
+, fetchPypi
 , jaraco_collections
-, objgraph, pytest, pytest-cov, pathpy, requests-toolbelt, pytest-services
+, more-itertools
+, objgraph
+, pathpy
+, portend
+, pytest-forked
+, pytest-services
+, pytestCheckHook
+, pythonAtLeast
+, pythonOlder
+, requests-toolbelt
+, routes
+, setuptools-scm
+, simplejson
+, zc_lockfile
 }:
 
 buildPythonPackage rec {
@@ -24,39 +39,49 @@ buildPythonPackage rec {
 
   propagatedBuildInputs = [
     # required
-    cheroot portend more-itertools zc_lockfile
+    cheroot
+    portend
+    more-itertools
+    zc_lockfile
     jaraco_collections
     # optional
     routes
+    simplejson
   ];
 
   checkInputs = [
-    objgraph pytest pytest-cov pathpy requests-toolbelt pytest-services
+    objgraph
+    pathpy
+    pytest-forked
+    pytest-services
+    pytestCheckHook
+    requests-toolbelt
   ];
 
-  
-  # daemonize and autoreload tests have issue with sockets within sandbox
-  # Disable doctest plugin because times out
   preCheck = ''
-    substituteInPlace pytest.ini --replace "--doctest-modules" ""
-    pytest \
-      -k 'not KeyboardInterrupt and not daemonize and not Autoreload' \
-      --deselect=cherrypy/test/test_static.py::StaticTest::test_null_bytes \
-      --deselect=cherrypy/test/test_tools.py::ToolTests::testCombinedTools \
-      ${lib.optionalString stdenv.isDarwin
-        "--deselect=cherrypy/test/test_bus.py::BusMethodTests::test_block --deselect=cherrypy/test/test_config_server.py"}
+    # Disable doctest plugin because times out
+    substituteInPlace pytest.ini \
+      --replace "--doctest-modules" "-vvv"
+    sed -i "/--cov/d" pytest.ini
   '';
 
+  pytestFlagsArray = [
+    "-W"
+    "ignore::DeprecationWarning"
+  ];
+
   disabledTests = [
     # Keyboard interrupt ends test suite run
-    ""
-    ""
-    ""
-    ""
+    "KeyboardInterrupt"
+    # daemonize and autoreload tests have issue with sockets within sandbox
+    "daemonize"
+    "Autoreload"
+  ] ++ lib.optionals stdenv.isDarwin [
+    "test_block"
   ];
 
-  disabledTestPaths = [
-    ""
+  disabledTestPaths = lib.optionals stdenv.isDarwin [
+    "cherrypy/test/test_config_server.py"
   ];
 
   __darwinAllowLocalNetworking = true;