test_float128
authorDebian Science Team <debian-science-maintainers@lists.alioth.debian.org>
Sun, 11 Oct 2020 17:08:21 +0000 (18:08 +0100)
committerDrew Parsons <dparsons@debian.org>
Sun, 11 Oct 2020 17:08:21 +0000 (18:08 +0100)
===================================================================

Gbp-Pq: Name test_float128.patch

python/test/unit/la/test_vector.py

index 10c42db7e1fdf4a7bde5cc5e3af3eb287c159617..a2ac58e7a405d8e3a957751c50ff270926908c81 100755 (executable)
@@ -398,13 +398,17 @@ class TestVectorForAnyBackend:
     xfail_type = pytest.mark.xfail(strict=True, raises=TypeError)
     xfail_type_py3 = pytest.mark.xfail(strict=True, raises=TypeError)
 
-
+    # some systems (32 bit arches) do not have numpy.float128
+    try:
+        test_float128 = numpy.float128(42.0)
+    except AttributeError:
+        test_float128 = numpy.longdouble(42.0)
     @pytest.mark.parametrize("operand",
                              [int(42), 42.0, numpy.sin(1.0), numpy.float(42.0),
                                 numpy.float64(42.0), numpy.float_(42.0),
                                 numpy.int(42.0), numpy.long(42.0),
                                 numpy.float16(42.0), numpy.float16(42.0),
-                                numpy.float32(42.0), numpy.float128(42.0),
+                                numpy.float32(42.0), test_float128,
                                 numpy.longfloat(42.0), numpy.int8(42.0),
                                 numpy.int16(42.0), numpy.int32(42.0),
                                 numpy.intc(42.0), numpy.longdouble(42.0),