Commit b87d3180 authored by Baptiste Mispelon's avatar Baptiste Mispelon Committed by Tim Graham
Browse files

[1.9.x] Fixed numpy deprecation warning silencing in template_tests.

Backport of 418658f4 from master
parent d5f1736d
Loading
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ from ..utils import setup

try:
    import numpy
    VisibleDeprecationWarning = numpy.VisibleDeprecationWarning
except ImportError:
    numpy = False

@@ -14,11 +15,12 @@ except ImportError:
@skipIf(numpy is False, "Numpy must be installed to run these tests.")
class NumpyTests(SimpleTestCase):
    # Ignore numpy deprecation warnings (#23890)
    if numpy:
        warnings.filterwarnings(
            "ignore",
            "Using a non-integer number instead of an "
            "integer will result in an error in the future",
        DeprecationWarning
            numpy.VisibleDeprecationWarning
        )

    @setup({'numpy-array-index01': '{{ var.1 }}'})