summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorVinicius Monego <monego@posteo.net>2020-07-23 15:23:26 -0300
committerMarius Bakke <marius@gnu.org>2020-07-25 18:47:56 +0200
commit8974f7d0653a3f7e7ba0a1884d60da2442cf5eca (patch)
tree60e005dcc06806076ad74a698561114763778a8d /gnu
parent4202af69b4e2ada5da3a8744dcd97d8a2fbf46e0 (diff)
downloadguix-8974f7d0653a3f7e7ba0a1884d60da2442cf5eca.tar.gz
gnu: Add python-pytest-openfiles.
* gnu/packages/python-check.scm (python-pytest-openfiles): New variable.

Signed-off-by: Marius Bakke <marius@gnu.org>
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 5647de98c7..5140057f91 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -215,6 +215,38 @@ provides a shortcut to testing all code and documentation for a given
 sub-package.")
     (license license:bsd-3)))
 
+(define-public python-pytest-openfiles
+  (package
+    (name "python-pytest-openfiles")
+    (version "0.5.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pytest-openfiles" version))
+       (sha256
+        (base32 "0n0a7fdc9m86360y96l23fvdmd6rw04bl6h5xqgl9qxfv08jk70p"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             ;; Make the installed plugin discoverable by Pytest.
+             (add-installed-pythonpath inputs outputs)
+             (invoke "pytest" "-vv"))))))
+    (native-inputs
+     `(("python-setuptools-scm" ,python-setuptools-scm)
+       ("python-pytest" ,python-pytest)))
+    (propagated-inputs
+     `(("python-psutil" ,python-psutil)))
+    (home-page "https://github.com/astropy/pytest-openfiles")
+    (synopsis "Pytest plugin for detecting inadvertent open file handles")
+    (description
+     "This package provides a plugin for the pytest framework that allows
+developers to detect whether any file handles or other file-like objects
+were inadvertently left open at the end of a unit test.")
+    (license license:bsd-3)))
+
 (define-public python-pytest-vcr
   ;; This commit fixes integration with pytest-5
   (let ((commit "4d6c7b3e379a6a7cba0b8f9d20b704dc976e9f05")