[Python-modules-commits] [python-django] 08/09: Fixed #26923 -- Fixed tests with older releases of numpy
Raphaël Hertzog
hertzog at moszumanska.debian.org
Thu Jul 21 08:48:53 UTC 2016
This is an automated email from the git hooks/post-receive script.
hertzog pushed a commit to branch debian/jessie-backports
in repository python-django.
commit f014680b108081f0db2b084acd09d59985e3cc49
Author: Raphaël Hertzog <hertzog at debian.org>
Date: Thu Jul 21 10:02:05 2016 +0200
Fixed #26923 -- Fixed tests with older releases of numpy
numpy.VisibleDeprecationWarning does not exist in older releases
of numpy that are still widely used (like 1.8.2 in Debian 8)
and we must deal properly with its non-existence.
Bug: https://code.djangoproject.com/ticket/26923
---
tests/template_tests/syntax_tests/test_numpy.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/template_tests/syntax_tests/test_numpy.py b/tests/template_tests/syntax_tests/test_numpy.py
index 16b4d74..50f4040 100644
--- a/tests/template_tests/syntax_tests/test_numpy.py
+++ b/tests/template_tests/syntax_tests/test_numpy.py
@@ -10,6 +10,8 @@ try:
VisibleDeprecationWarning = numpy.VisibleDeprecationWarning
except ImportError:
numpy = False
+except AttributeError:
+ VisibleDeprecationWarning = DeprecationWarning
@skipIf(numpy is False, "Numpy must be installed to run these tests.")
@@ -20,7 +22,7 @@ class NumpyTests(SimpleTestCase):
"ignore",
"Using a non-integer number instead of an "
"integer will result in an error in the future",
- numpy.VisibleDeprecationWarning
+ VisibleDeprecationWarning
)
@setup({'numpy-array-index01': '{{ var.1 }}'})
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-django.git
More information about the Python-modules-commits
mailing list