diff mbox series

[bug#51222,17/25] gnu: Add python-aioresponses.

Message ID 20211015024036.53831-17-sl@eauchat.org
State Accepted
Headers show
Series Package python-pantalaimon | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Sébastien Lerique Oct. 15, 2021, 2:40 a.m. UTC
* gnu/packages/python-xyz.scm (python-aioresponses): New variable.
---
 gnu/packages/python-xyz.scm | 40 +++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 0aaac07d32..02e605b16d 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -229,6 +229,46 @@ 
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26))
 
+(define-public python-aioresponses
+  (package
+    (name "python-aioresponses")
+    (version "0.7.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "aioresponses" version))
+       (sha256
+        (base32 "16p8mdyfirddrsay62ji7rwcrqmmzxzf2isdbfm9cj5p338rbr42"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (when tests?
+               (invoke
+                "pytest" "-vv" "tests" "-k"
+                (string-append
+                 ;; These tests require network access.
+                 "not test_address_as_instance_of_url_combined_with_pass_through "
+                 "and not test_pass_through_with_origin_params"))))))))
+    (native-inputs
+     `(("python-pbr" ,python-pbr)
+       ("python-ddt" ,python-ddt)
+       ("python-pytest" ,python-pytest)))
+    (propagated-inputs
+     `(("python-aiohttp" ,python-aiohttp)))
+    (home-page "https://github.com/pnuckowski/aioresponses")
+    (synopsis "Mock out requests made by ClientSession from aiohttp package")
+    (description
+     "Aioresponses is a helper to mock/fake web requests in python aiohttp
+package.  For requests module there are a lot of packages that help us with
+testing (eg. httpretty, responses, requests-mock).  When it comes to testing
+asynchronous HTTP requests it is a bit harder (at least at the beginning).
+The purpose of this package is to provide an easy way to test asynchronous
+HTTP requests.")
+    (license license:expat)))
+
 (define-public python-ueberzug
   (package
     (name "python-ueberzug")