Source: python-numpy
Version: 1:1.16.2-1ubuntu1
Severity: important
Tags: patch

Dear Maintainer,

The tests are run during build like this:

python$$v -c "import sys ; sys.path.insert(0, 
'./tmp/usr/lib/python3/dist-packages/') ; import numpy; numpy.test(verbose=5)"

but numpy.test returns a boolean True/False to indicate whether it
passed or failed, not raising an exception or anything else that would
cause python to exit with a non-zero code. Simple, untested, patch
attached.

Cheers,
mwh

-- System Information:
Debian Release: buster/sid
  APT prefers eoan
  APT policy: (500, 'eoan'), (400, 'eoan-proposed')
Architecture: amd64 (x86_64)

Kernel: Linux 5.3.0-18-generic (SMP w/8 CPU cores)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_WARN, TAINT_OOT_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
>From f7405ec04b68a80cba5d0bc83188a6262e8ada38 Mon Sep 17 00:00:00 2001
From: Michael Hudson-Doyle <michael.hud...@canonical.com>
Date: Thu, 24 Oct 2019 12:46:38 +1300
Subject: [PATCH] make sure failing tests fail the build

---
 debian/rules | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/debian/rules b/debian/rules
index b4381f5..2c50338 100755
--- a/debian/rules
+++ b/debian/rules
@@ -116,9 +116,9 @@ ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
        set -e; for v in $(PY3VERS) ; do \
                cd debian ; \
                echo "-- running tests for "$$v" plain --" ; \
-               python$$v -c "import sys ; sys.path.insert(0, 
'./tmp/usr/lib/python3/dist-packages/') ; import numpy; numpy.test(verbose=5)" 
; \
+               python$$v -c "import sys ; sys.path.insert(0, 
'./tmp/usr/lib/python3/dist-packages/') ; import numpy; 
sys.exit(numpy.test(verbose=5))" ; \
                echo "-- running tests for "$$v" debug --" ; \
-               python$$v-dbg -c "import sys ; sys.path.insert(0, 
'./tmp/usr/lib/python3/dist-packages/') ; import numpy; numpy.test(verbose=5)" 
; \
+               python$$v-dbg -c "import sys ; sys.path.insert(0, 
'./tmp/usr/lib/python3/dist-packages/') ; import numpy; sys.exit(not 
numpy.test(verbose=5))" ; \
                cd .. ; \
        done
 endif
-- 
2.20.1

Reply via email to