[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/12: gnu: python-jupyter-core: Enable tests.
From: |
guix-commits |
Subject: |
02/12: gnu: python-jupyter-core: Enable tests. |
Date: |
Mon, 26 Apr 2021 04:37:48 -0400 (EDT) |
lbraun pushed a commit to branch master
in repository guix.
commit 51646c5435a868e0d87304d4edfe109b1fe2f545
Author: Lars-Dominik Braun <lars@6xq.net>
AuthorDate: Tue Apr 20 08:57:14 2021 +0200
gnu: python-jupyter-core: Enable tests.
* gnu/packages/python-xyz.scm (python-jupyter-core) [arguments]: Enable
tests.
[native-inputs]: Add test dependencies.
---
gnu/packages/python-xyz.scm | 26 ++++++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index a26e005..d6f7387 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -7384,10 +7384,32 @@ without using the configuration machinery.")
(base32
"1d12j5hkff0xiax87pnhmzbsph3jqqzhz16h8xld7z2y4armq0kr"))))
(build-system python-build-system)
- ;; FIXME: not sure how to run the tests
- (arguments `(#:tests? #f))
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+ (when tests?
+ ; Some tests write to $HOME.
+ (setenv "HOME" "/tmp")
+ ; Some tests load the installed package.
+ (add-installed-pythonpath inputs outputs)
+ (invoke "pytest" "-vv"))))
+ (add-after 'unpack 'patch-testsuite
+ (lambda _
+ ;; test_not_on_path() and test_path_priority() try to run a test
+ ;; that loads jupyter_core, so we need PYTHONPATH
+ (substitute* "jupyter_core/tests/test_command.py"
+ (("env = \\{'PATH': ''\\}")
+ "env = {'PATH': '', 'PYTHONPATH': os.environ['PYTHONPATH']}")
+ (("env = \\{'PATH': str\\(b\\)\\}")
+ "env = {'PATH': str(b), 'PYTHONPATH':
os.environ['PYTHONPATH']}"))
+ #t)))))
(propagated-inputs
`(("python-traitlets" ,python-traitlets)))
+ (native-inputs
+ `(("python-six" ,python-six)
+ ("python-pytest" ,python-pytest)))
;; This package provides the `jupyter` binary and thus also exports the
;; search paths.
(native-search-paths
- branch master updated (2ff36e4 -> 2209e5c), guix-commits, 2021/04/26
- 01/12: gnu: Move search path JUPYTER_PATH., guix-commits, 2021/04/26
- 02/12: gnu: python-jupyter-core: Enable tests.,
guix-commits <=
- 05/12: gnu: python-nbformat: Enable tests., guix-commits, 2021/04/26
- 06/12: gnu: Add python-jupyter-client-bootstrap., guix-commits, 2021/04/26
- 07/12: gnu: Add python-ipykernel-bootstrap., guix-commits, 2021/04/26
- 10/12: gnu: Add python-pytest-dependency., guix-commits, 2021/04/26
- 11/12: gnu: python-nbconvert: Enable more tests., guix-commits, 2021/04/26
- 08/12: gnu: python-jupyter-client: Enable tests., guix-commits, 2021/04/26
- 03/12: gnu: Add python-json-spec., guix-commits, 2021/04/26
- 04/12: gnu: Add python-fastjsonschema., guix-commits, 2021/04/26
- 09/12: gnu: python-ipykernel: Add missing inputs., guix-commits, 2021/04/26
- 12/12: gnu: python-notebook: Fix tests., guix-commits, 2021/04/26