diff mbox series

[bug#53179,v2,3/3] gnu: Add python-pytest-httpx.

Message ID 20220114210846.171922-3-monego@posteo.net
State Accepted
Headers show
Series [bug#53179,v2,1/3] gnu: python-httpcore: Update to 0.13.7. | 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

Vinicius Monego Jan. 14, 2022, 9:08 p.m. UTC
* gnu/packages/python-check.scm (python-pytest-httpx): New variable.
---
 gnu/packages/python-check.scm | 34 +++++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index 181aa8b05c..8df1dd67eb 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -7,7 +7,7 @@ 
 ;;; Copyright © 2020 Julien Lepiller <julien@lepiller.eu>
 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2020 Edouard Klein <edk@beaver-labs.com>
-;;; Copyright © 2020, 2021 Vinicius Monego <monego@posteo.net>
+;;; Copyright © 2020, 2021, 2022 Vinicius Monego <monego@posteo.net>
 ;;; Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org>
 ;;; Copyright © 2021 Sharlatan Hellseher <sharlatanus@gmail.com>
 ;;; Copyright © 2021 Brendan Tildesley <mail@brendan.scot>
@@ -1789,6 +1789,38 @@  execution of a test suite.  It will also store a history of all test runs to
 help in debugging failures and optimizing the scheduler to improve speed.")
     (license license:asl2.0)))
 
+(define-public python-pytest-httpx
+  (package
+    (name "python-pytest-httpx")
+    (version "0.13.0")
+    (source
+     (origin
+       (method git-fetch)               ; no tests in PyPI release
+       (uri (git-reference
+             (url "https://github.com/Colin-b/pytest_httpx")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0lh7df3ysxmjzvx6242xb6qiwpfxrnj70kjmw5sndvzmy5dfpxfc"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+             (when tests?
+               (add-installed-pythonpath inputs outputs)
+               (invoke "python" "-m" "pytest")))))))
+    (propagated-inputs
+     (list python-httpx))
+    (native-inputs
+     (list python-pytest-asyncio python-pytest python-pytest-cov))
+    (home-page "https://colin-b.github.io/pytest_httpx/")
+    (synopsis "Pytest fixture to mock HTTPX")
+    (description "This package provides a Pytest fixture that will make sure
+every @code{httpx} request will be replied to with user provided responses.")
+    (license license:expat)))
+
 ;; This is only used by python-sanic
 (define-public python-pytest-sanic
   (package