From 41ba9df6ba3b18cd2f7d92c82447111399342a10 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 26 Apr 2023 16:07:34 +0200 Subject: [PATCH] gnu: python-tornado: Run a lot more tests and fix collections. * gnu/packages/python-web.scm (python-tornado)[arguments]: Do run tests; add phase 'fix-collections. --- gnu/packages/python-web.scm | 38 ++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm index 070aee99b9..770778590d 100644 --- a/gnu/packages/python-web.scm +++ b/gnu/packages/python-web.scm @@ -2246,17 +2246,33 @@ data.") "02clqk2116jbnq8lnaqmdw3p52nqrd9ib59r4xz2ll43fpcmhlaf")))) (build-system python-build-system) (arguments - '(;; FIXME: Two tests error out with: - ;; AssertionError: b'Error in atexit._run_exitfuncs:\nFileNotF[44 chars]ry\n' != b'' - ;; #:phases - ;; (modify-phases %standard-phases - ;; (replace 'check - ;; (lambda _ - ;; ;; 'setup.py test' hits an AssertionError on BSD-specific - ;; ;; "tornado/platform/kqueue.py". This is the supported method: - ;; (invoke "python" "-m" "tornado.test.runtests") - ;; #t))) - #:tests? #f)) + (list + #:phases + '(modify-phases %standard-phases + (add-after 'unpack 'fix-collections + (lambda _ + (substitute* "tornado/httputil.py" + (("collections.MutableMapping") + "collections.abc.MutableMapping")))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (substitute* "tornado/test/runtests.py" + (("\"error\", category=DeprecationWarning") + "\"ignore\", category=DeprecationWarning") + ;; Disable tests that use SSL. + (("'tornado.test.simple_httpclient_test',") "") + (("'tornado.test.iostream_test',") "") + (("'tornado.test.httpserver_test',") "") + ;; Some timeouts are triggered in these two modules + (("'tornado.test.queues_test',") "") + (("'tornado.test.locks_test',") "")) + ;; Skip all network tests + (setenv "NO_NETWORK" "1") + ;; Skip timing-relevant tests + (setenv "TRAVIS" "1") + (invoke "python" "-m" "tornado.test.runtests" + "--verbose=yes"))))))) (native-inputs (list python-certifi)) (home-page "https://www.tornadoweb.org/")