gnu: python: Disable failing tests for Python 2.

Fixes issue #35311 (see: https://bugs.gnu.org/35311).

* gnu/packages/python.scm (python-2.7)[make-flags]: Exclude the tests
  test_urllib2_localnet and test_httplib.
* gnu/packages/python.scm (python-3.7)[make-flags]: Do not consider tests
  exclusions inherited from the python2 package, which leaves Python 3 unchanged.
This commit is contained in:
Maxim Cournoyer 2019-04-17 23:39:39 -04:00
parent 6bbb37a545
commit e337061b3a
No known key found for this signature in database
GPG Key ID: 1260E46482E63562
1 changed files with 12 additions and 2 deletions

View File

@ -54,7 +54,7 @@
;;; Copyright © 2018 Nicolas Goaziou <mail@nicolasgoaziou.fr>
;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
;;; Copyright © 2018 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2018, 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2018 Luther Thompson <lutheroto@gmail.com>
;;; Copyright © 2018 Vagrant Cascadian <vagrant@debian.org>
;;;
@ -147,7 +147,14 @@
(assoc-ref %outputs "out") "/lib"))
;; With no -j argument tests use all available cpus, so provide one.
#:make-flags
(list (format #f "TESTOPTS=-j~d" (parallel-job-count)))
(list (string-append
(format #f "TESTOPTS=-j~d" (parallel-job-count))
;; Exclude the following tests as they fail
;; non-deterministically with "error: [Errno 104] Connection
;; reset by peer." Python 3 seems unaffected. A potential fix,
;; yet to be backported to Python 2, is available at:
;; https://github.com/python/cpython/commit/529525fb5a8fd9b96ab4021311a598c77588b918.
" --exclude test_urllib2_localnet test_httplib"))
#:modules ((ice-9 ftw) (ice-9 match)
(guix build utils) (guix build gnu-build-system))
@ -344,6 +351,9 @@ data types.")
#t))))
(arguments
(substitute-keyword-arguments (package-arguments python-2)
((#:make-flags _)
;; Strip tests exclusions that have to do with Python 2 only.
`(list (format #f "TESTOPTS=-j~d" (parallel-job-count))))
((#:phases phases)
`(modify-phases ,phases
;; Unset SOURCE_DATE_EPOCH while running the test-suite and set it