diff mbox series

[bug#69591,v2,06/31] gnu: Add python-expecttest.

Message ID 20240312225211.16427-6-david.elsing@posteo.net
State New
Headers show
Series Unbundle and update python-pytorch | expand

Commit Message

David Elsing March 12, 2024, 10:51 p.m. UTC
* gnu/packages/python-check.scm (python-expecttest): New variable.
---
 gnu/packages/python-check.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index f876088488..dbca80652c 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -2078,6 +2078,41 @@  (define-public python-eradicate
 valid Python syntax that are likely to be commented out code.")
     (license license:expat)))
 
+(define-public python-expecttest
+  (let ((commit "683b09a352cc426851adc2e3a9f46e0ab25e4dee")
+        (revision "0"))
+    (package
+      (name "python-expecttest")
+      (version (git-version "0.2.1" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/ezyang/expecttest")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32
+           "1djwxp9x1hczzxbimv1b1bmd083am88v27l82nmlkhvzyg2cmpvv"))))
+      (build-system pyproject-build-system)
+      (arguments
+       (list
+        #:phases
+        #~(modify-phases %standard-phases
+            (replace 'check
+              (lambda* (#:key tests? #:allow-other-keys)
+                (when tests?
+                  ;; The test runs tests expected to fail, so the output is
+                  ;; confusing
+                  (invoke "python3" "test_expecttest.py")))))))
+      (native-inputs (list python-hypothesis poetry))
+      (home-page "https://github.com/ezyang/expecttest")
+      (synopsis "Python module for expect tests")
+      (description "@code{expecttest} is a Python module for expect tests, where
+the initial expected value of a test can be automatically set by running the
+test itself.")
+      (license license:expat))))
+
 (define-public python-robber
   (package
     (name "python-robber")