summary refs log tree commit diff
path: root/gnu/packages/check.scm
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2021-08-26 09:50:14 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2021-08-29 01:05:28 -0400
commitb1ef8b410c334debee1e9ff577a69c6a21220100 (patch)
tree80a7b3758468824549057dc62270b81dda9dec40 /gnu/packages/check.scm
parent0a2c8b10fc74606ec41c7b4d8d9b11bb91ba86ee (diff)
downloadguix-b1ef8b410c334debee1e9ff577a69c6a21220100.tar.gz
gnu: python-pytest-asyncio: Enable tests and patch for Python 3.8.
* gnu/packages/patches/python-pytest-asyncio-python-3.8.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/check.scm (python-pytest-asyncio)
[source]: Fetch from git and apply above patch.
[phases]: Override the check phase, enabling tests.
Diffstat (limited to 'gnu/packages/check.scm')
-rw-r--r--gnu/packages/check.scm21
1 files changed, 18 insertions, 3 deletions
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index b384b8297a..43689c3670 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -1730,14 +1730,29 @@ executed.")
 (define-public python-pytest-asyncio
   (package
     (name "python-pytest-asyncio")
+    ;; Version 0.10.0 is the last version which is compatible with Pytest <=
+    ;; 5.4.0.
     (version "0.10.0")
     (source
      (origin
-       (method url-fetch)
-       (uri (pypi-uri "pytest-asyncio" version))
+       (method git-fetch)               ;for tests
+       (uri (git-reference
+             (url "https://github.com/pytest-dev/pytest-asyncio")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
        (sha256
-        (base32 "1bysy4nii13bm7h345wxf8fxcjhab7l374pqdv7vwv3izl053b4z"))))
+        (base32
+         "1m63b7nbph5z20mn8jgh6j9ac873i1k4in29x44vrkw3qwfwg13y"))
+       (patches (search-patches "python-pytest-asyncio-python-3.8.patch"))))
     (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 "pytest" "-vv")))))))
     (native-inputs
      `(("python-coverage" ,python-coverage)
        ("python-async-generator" ,python-async-generator)