summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-04-18 01:23:56 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-05-12 12:45:52 -0400
commit72d292eac0345918f7313588f9e6de1a83e57952 (patch)
treea95a384d01802daf870d8936b17fe8bd23820df8
parent1f5f4cc1a2076ef40121f9e6c858e7c3081c7ef4 (diff)
downloadguix-patches-72d292eac0345918f7313588f9e6de1a83e57952.tar
guix-patches-72d292eac0345918f7313588f9e6de1a83e57952.tar.gz
gnu: python-sqlalchemy: Run tests in parallel via xdist.
* gnu/packages/databases.scm (python-sqlalchemy)[phases]: Use gexps. {check}: Run tests in parallel; skip slow test_memusage. * gnu/packages/databases.scm (python2-sqlalchemy): Adjust to avoid xdist.
-rw-r--r--gnu/packages/databases.scm39
1 files changed, 30 insertions, 9 deletions
diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index c70173b329..ce0e035f76 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -32,7 +32,7 @@
;;; Copyright © 2017 Kristofer Buffington <kristoferbuffington@gmail.com>
;;; Copyright © 2018 Amirouche Boubekki <amirouche@hypermove.net>
;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
-;;; Copyright © 2018, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2018, 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2019 Jack Hill <jackhill@jackhill.us>
;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
;;; Copyright © 2019 Gábor Boskovits <boskovits@gmail.com>
@@ -3367,16 +3367,21 @@ Database API 2.0T.")
(build-system python-build-system)
(native-inputs
(list python-cython ; for C extensions
- python-pytest python-mock)) ; for tests
+ python-pytest python-mock python-pytest-xdist)) ; for tests
(propagated-inputs
(list python-greenlet))
(arguments
- `(#:phases
- (modify-phases %standard-phases
- (replace 'check
- (lambda* (#:key tests? #:allow-other-keys)
- (when tests?
- (invoke "py.test")))))))
+ (list
+ #:phases
+ #~(modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (invoke "pytest" "-vv"
+ "-n" (number->string (parallel-job-count))
+ ;; The memory usage tests are very expensive and run in
+ ;; sequence; skip them.
+ "-k" "not test_memusage.py")))))))
(home-page "https://www.sqlalchemy.org")
(synopsis "Database abstraction library")
(description
@@ -3388,7 +3393,23 @@ simple and Pythonic domain language.")
(license license:x11)))
(define-public python2-sqlalchemy
- (package-with-python2 python-sqlalchemy))
+ (let ((base (package-with-python2 python-sqlalchemy)))
+ (package
+ (inherit base)
+ (arguments
+ (substitute-keyword-arguments (package-arguments base)
+ ((#:phases phases)
+ #~(modify-phases #$phases
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (invoke "pytest" "-vv"
+ ;; The memory usage tests are very expensive and run in
+ ;; sequence; skip them.
+ "-k" "not test_memusage.py"))))))))
+ ;; Do not use pytest-xdist, which is broken for Python 2.
+ (native-inputs (modify-inputs (package-native-inputs base)
+ (delete "python-pytest-xdist"))))))
(define-public python-sqlalchemy-stubs
(package