summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2022-02-15 00:13:08 +0100
committerMarius Bakke <marius@gnu.org>2022-02-15 00:21:16 +0100
commit48daa39724487607f07c192e47a18834f1e65182 (patch)
tree4ebd0ce5a8d7403ff317fe6347104c5948cc63b9 /gnu
parentf6350f003edd9864a6fc283b27cdf731ff9b5339 (diff)
gnu: python-argh: Fix test failure.
* gnu/packages/python-xyz.scm (python-argh)[arguments]: Add patch-tests phase and override check phase.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/python-xyz.scm16
1 files changed, 16 insertions, 0 deletions
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index f09c40fae8..5c003e3c1a 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -24567,6 +24567,22 @@ itself.")
(base32
"1p5h3dnpbsjmqrvil96s71asc6i3gpinmbrabqmwnrsxprz7r3ns"))))
(build-system python-build-system)
+ (arguments
+ '(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'patch-tests
+ (lambda _
+ ;; Fix test failures on Python 3.9.9+.
+ ;; Taken via <https://github.com/neithere/argh/issues/148>.
+ (substitute* "test/test_integration.py"
+ (("assert run\\(p, '(bar|orig-name|nest bar)', exit=True\\)\
+\\.startswith\\('invalid choice'\\)" _ name)
+ (string-append "assert 'invalid choice' in \
+run(p, '" name "', exit=True)")))))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (invoke "pytest" "-vv")))))))
(propagated-inputs
(list python-iocapture python-mock python-pytest python-pytest-cov
python-pytest-xdist))