mirror of
https://github.com/django/django.git
synced 2025-06-05 03:29:12 +00:00
[1.10.x] Fixed numpy deprecation warning silencing in template_tests.
Backport of 418658f453bed7fe7949dda26651aab370003e6a from master
This commit is contained in:
parent
a2af2420ce
commit
4b6560f5a9
@ -7,6 +7,7 @@ from ..utils import setup
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
import numpy
|
import numpy
|
||||||
|
VisibleDeprecationWarning = numpy.VisibleDeprecationWarning
|
||||||
except ImportError:
|
except ImportError:
|
||||||
numpy = False
|
numpy = False
|
||||||
|
|
||||||
@ -14,12 +15,13 @@ except ImportError:
|
|||||||
@skipIf(numpy is False, "Numpy must be installed to run these tests.")
|
@skipIf(numpy is False, "Numpy must be installed to run these tests.")
|
||||||
class NumpyTests(SimpleTestCase):
|
class NumpyTests(SimpleTestCase):
|
||||||
# Ignore numpy deprecation warnings (#23890)
|
# Ignore numpy deprecation warnings (#23890)
|
||||||
warnings.filterwarnings(
|
if numpy:
|
||||||
"ignore",
|
warnings.filterwarnings(
|
||||||
"Using a non-integer number instead of an "
|
"ignore",
|
||||||
"integer will result in an error in the future",
|
"Using a non-integer number instead of an "
|
||||||
DeprecationWarning
|
"integer will result in an error in the future",
|
||||||
)
|
numpy.VisibleDeprecationWarning
|
||||||
|
)
|
||||||
|
|
||||||
@setup({'numpy-array-index01': '{{ var.1 }}'})
|
@setup({'numpy-array-index01': '{{ var.1 }}'})
|
||||||
def test_numpy_array_index01(self):
|
def test_numpy_array_index01(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user