summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2021-10-14 15:51:44 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2021-10-15 13:02:53 -0400
commit0930ca2c63fb57d9d7dba5bfb0f092ba3f09d961 (patch)
treec3f3849f6f3c6b0bd2dc8793a695bd4642121467 /gnu
parent1fdad09d1c48cfc02eabd056d96b52c7fef465cb (diff)
downloadguix-0930ca2c63fb57d9d7dba5bfb0f092ba3f09d961.tar.gz
gnu: Add python-mockito.
* gnu/packages/python-check.scm (python-mockito): New variable.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/python-check.scm32
1 files changed, 32 insertions, 0 deletions
diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index 8252f02182..0421210c27 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -1415,6 +1415,38 @@ the implementation of that name.")
     (license (list license:asl2.0
                    license:lgpl3))))    ; only for setup_helpers.py
 
+(define-public python-mockito
+  (package
+    (name "python-mockito")
+    (version "1.2.2")
+    (source
+     (origin
+       (method git-fetch)               ;no tests in pypi archive
+       (uri (git-reference
+             (url "https://github.com/kaste/mockito-python")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0fg8jflcf4c929gd4zbcrk73d08waaqjfjmdjrgnv54mzl35pjxl"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (when tests?
+               (invoke "pytest")))))))
+    (native-inputs
+     `(("python-numpy" ,python-numpy)
+       ("python-pytest" ,python-pytest)))
+    (home-page "https://github.com/kaste/mockito-python")
+    (synopsis "Mocking library for Python")
+    (description "This package provides a Python implementation of the Java
+library of the same name.  It eases monkey patching, for example to stub out
+side effects when unit testing.")
+    (license license:expat)))
+
 (define-public python-mypy-extensions
   (package
     (name "python-mypy-extensions")