about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/aiohttp/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/aiohttp/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/aiohttp/default.nix49
1 files changed, 30 insertions, 19 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/aiohttp/default.nix b/nixpkgs/pkgs/development/python-modules/aiohttp/default.nix
index 7d164cf5e4f0..c58944a59d72 100644
--- a/nixpkgs/pkgs/development/python-modules/aiohttp/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/aiohttp/default.nix
@@ -3,7 +3,6 @@
 , buildPythonPackage
 , fetchPypi
 , pythonOlder
-, pythonAtLeast
 , attrs
 , chardet
 , multidict
@@ -12,9 +11,8 @@
 , idna-ssl
 , typing-extensions
 , pytestrunner
-, pytest
+, pytestCheckHook
 , gunicorn
-, pytest-timeout
 , async_generator
 , pytest_xdist
 , pytestcov
@@ -22,13 +20,14 @@
 , trustme
 , brotlipy
 , freezegun
+, isPy38
 }:
 
 buildPythonPackage rec {
   pname = "aiohttp";
   version = "3.6.2";
   # https://github.com/aio-libs/aiohttp/issues/4525 python3.8 failures
-  disabled = pythonOlder "3.5" || pythonAtLeast "3.8";
+  disabled = pythonOlder "3.5";
 
   src = fetchPypi {
     inherit pname version;
@@ -36,28 +35,40 @@ buildPythonPackage rec {
   };
 
   checkInputs = [
-    pytestrunner pytest gunicorn async_generator pytest_xdist
+    pytestrunner pytestCheckHook gunicorn async_generator pytest_xdist
     pytest-mock pytestcov trustme brotlipy freezegun
   ];
 
   propagatedBuildInputs = [ attrs chardet multidict async-timeout yarl ]
     ++ lib.optionals (pythonOlder "3.7") [ idna-ssl typing-extensions ];
 
-  # disable tests which attempt to do loopback connections
-  checkPhase = ''
+  disabledTests = [
+    # disable tests which attempt to do loopback connections
+    "get_valid_log_format_exc"
+    "test_access_logger_atoms"
+    "aiohttp_request_coroutine"
+    "server_close_keepalive_connection"
+    "connector"
+    "client_disconnect"
+    "handle_keepalive_on_closed_connection"
+    "proxy_https_bad_response"
+    "partially_applied_handler"
+    "middleware"
+  ] ++ lib.optionals stdenv.is32bit [
+    "test_cookiejar"
+  ] ++ lib.optionals isPy38 [
+    # Python 3.8  https://github.com/aio-libs/aiohttp/issues/4525
+    "test_read_boundary_with_incomplete_chunk"
+    "test_read_incomplete_chunk"
+    "test_request_tracing_exception"
+  ] ++ lib.optionals stdenv.isDarwin [
+    "test_close"
+  ];
+
+  # aiohttp in current folder shadows installed version
+  # Probably because we run `python -m pytest` instead of `pytest` in the hook.
+  preCheck = ''
     cd tests
-    pytest -k "not get_valid_log_format_exc \
-               and not test_access_logger_atoms \
-               and not aiohttp_request_coroutine \
-               and not server_close_keepalive_connection \
-               and not connector \
-               and not client_disconnect \
-               and not handle_keepalive_on_closed_connection \
-               and not proxy_https_bad_response \
-               and not partially_applied_handler \
-               ${lib.optionalString stdenv.is32bit "and not test_cookiejar"} \
-               and not middleware" \
-      --ignore=test_connector.py
   '';
 
   meta = with lib; {