mirror of
https://github.com/django/django.git
synced 2025-10-01 22:41:31 +00:00
[1.10.x] Fixed numpy deprecation warning silencing in template_tests.
Backport of 418658f453
from master
This commit is contained in:
parent
a2af2420ce
commit
4b6560f5a9
1 changed files with 8 additions and 6 deletions
|
@ -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 }}'})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue