mirror of
https://github.com/django/django.git
synced 2025-06-07 04:29:12 +00:00
Fixed numpy deprecation warning silencing in template_tests.
This commit is contained in:
parent
2f587737d7
commit
418658f453
@ -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,11 +15,12 @@ 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)
|
||||||
|
if numpy:
|
||||||
warnings.filterwarnings(
|
warnings.filterwarnings(
|
||||||
"ignore",
|
"ignore",
|
||||||
"Using a non-integer number instead of an "
|
"Using a non-integer number instead of an "
|
||||||
"integer will result in an error in the future",
|
"integer will result in an error in the future",
|
||||||
DeprecationWarning
|
numpy.VisibleDeprecationWarning
|
||||||
)
|
)
|
||||||
|
|
||||||
@setup({'numpy-array-index01': '{{ var.1 }}'})
|
@setup({'numpy-array-index01': '{{ var.1 }}'})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user