build-system/pyproject: Always run tests verbosely for supported backends.

* guix/build-system/pyproject.scm (pyproject-build): Default to '() instead of
 #false for TEST-FLAGS.
* guix/build/pyproject-build-system.scm (check): Unconditionally enable
verbose test flags.
* doc/guix.texi (Build Systems): Document this change.
* gnu/packages/fontutils.scm (python-glyphslib)[arguments]: Remove verbosity
from #:test-flags.
* gnu/packages/pdf.scm (python-pydyf, weasyprint)[arguments]: Likewise.
* gnu/packages/python-web.scm (python-openapi-spec-validator)[arguments]: Likewise.
* gnu/packages/python-xyz.scm (python-path, python-tempora)[arguments]: Likewise.
This commit is contained in:
Marius Bakke 2022-10-27 20:31:38 +02:00
parent 6ef998d54e
commit e944734ef9
No known key found for this signature in database
GPG key ID: A2A06DF2A33A54FA
7 changed files with 17 additions and 15 deletions

View file

@ -9332,8 +9332,9 @@ to guess the appropriate backend based on @file{pyproject.toml}.
@code{#:test-backend} is added. It defaults to @code{#false} and will guess
an appropriate test backend based on what is available in package inputs.
@item
@code{#:test-flags} is added. The default is @code{#false}, and varies based
on the detected @code{#:test-backend}.
@code{#:test-flags} is added. The default is @code{'()}. These flags are
passed as arguments to the test command. Note that flags for verbose output
is always enabled on supported backends.
@end itemize
It is considered ``experimental'' in that the implementation details are

View file

@ -598,8 +598,7 @@ (define-public python-glyphslib
(build-system pyproject-build-system)
(arguments
(list
#:test-flags #~'("-vv"
;; These fail because the test data has not yet been
#:test-flags #~'(;; These fail because the test data has not yet been
;; updated for newer FontTools:
;; https://github.com/googlefonts/glyphsLib/issues/787
;; Re-enable for versions > 6.0.7.

View file

@ -739,7 +739,7 @@ (define-public python-pydyf
(build-system pyproject-build-system)
(arguments
(list
#:test-flags #~'("-vv" "-c" "/dev/null")))
#:test-flags #~'("-c" "/dev/null")))
(propagated-inputs (list python-pillow))
(native-inputs
(list ghostscript
@ -1500,7 +1500,7 @@ (define-public weasyprint
(build-system pyproject-build-system)
(arguments
(list
#:test-flags #~(list "-vv" "-c" "/dev/null"
#:test-flags #~(list "-c" "/dev/null"
"-n" (number->string (parallel-job-count)))
#:phases
#~(modify-phases %standard-phases

View file

@ -1648,7 +1648,7 @@ (define-public python-openapi-spec-validator
(list
;; The example tests attempt to fetch resources from the Internet
;; (see: https://github.com/p1c2u/openapi-spec-validator/issues/151).
#:test-flags #~'("-vv" "-k" "not Example and not Exampe")
#:test-flags #~'("-k" "not Example and not Exampe")
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'remove-coverage-pytest-options

View file

@ -12753,7 +12753,7 @@ (define-public python-path
((#:tests? _ #f)
(not (%current-target-system)))
((#:test-flags flags #~'())
#~(append (list "-vv" "-k"
#~(append (list "-k"
(string-append
;; Do not test the myproject.toml build as it tries
;; to pull dependencies from the Internet.
@ -21366,7 +21366,7 @@ (define-public python-tempora
(arguments
;; Do not test the myproject.toml build as it tries to pull
;; dependencies from the Internet.
(list #:test-flags #~'("-vv" "-k" "not project")))
(list #:test-flags #~'("-k" "not project")))
(native-inputs
(list python-freezegun
python-pytest

View file

@ -95,7 +95,7 @@ (define* (pyproject-build name inputs
(configure-flags ''())
(build-backend #f)
(test-backend #f)
(test-flags #f)
(test-flags ''())
(phases '%standard-phases)
(outputs '("out" "wheel"))
(search-paths '())

View file

@ -158,14 +158,16 @@ (define* (check #:key tests? test-backend test-flags #:allow-other-keys)
(format #t "Using ~a~%" use-test-backend)
(match use-test-backend
('pytest
(apply invoke (cons pytest (or test-flags '("-vv")))))
(apply invoke pytest "-vv" test-flags))
('nose
(apply invoke (cons nosetests (or test-flags '("-v")))))
(apply invoke nosetests "-v" test-flags))
('nose2
(apply invoke (cons nose2 (or test-flags '("-v" "--pretty-assert")))))
(apply invoke nose2 "-v" "--pretty-assert" test-flags))
('setup.py
(apply invoke (append '("python" "setup.py")
(or test-flags '("test" "-v")))))
(apply invoke "python" "setup.py"
(if (null? test-flags)
'("test" "-v")
test-flags)))
;; The developer should explicitly disable tests in this case.
(else (raise (condition (&test-system-not-found))))))
(format #t "test suite not run~%")))