Opened 11 years ago
Closed 11 years ago
#23489 closed Bug (fixed)
Test failures with numpy 1.9
| Reported by: | Tim Graham | Owned by: | nobody |
|---|---|---|---|
| Component: | Template system | Version: | 1.7 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Installing numpy 1.9 and ./runtests template_tests will give some test failures like this:
Template test (Cached='True', TEMPLATE_STRING_IF_INVALID='', TEMPLATE_DEBUG=True): numpy-array-index02 -- FAILED. Got <type 'exceptions.IndexError'>, exception: index 5 is out of bounds for axis 0 with size 2
Traceback (most recent call last):
File "/home/tim/code/django/tests/template_tests/tests.py", line 596, in test_templates
output = self.render(test_template, vals)
File "/home/tim/code/django/tests/template_tests/tests.py", line 622, in render
output = test_template.render(context)
File "/home/tim/code/django/django/template/base.py", line 150, in render
return self._render(context)
File "/home/tim/code/django/django/test/utils.py", line 89, in instrumented_test_render
return self.nodelist.render(context)
File "/home/tim/code/django/django/template/base.py", line 853, in render
bit = self.render_node(node, context)
File "/home/tim/code/django/django/template/debug.py", line 80, in render_node
return node.render(context)
File "/home/tim/code/django/django/template/debug.py", line 90, in render
output = self.filter_expression.resolve(context)
File "/home/tim/code/django/django/template/base.py", line 598, in resolve
obj = self.var.resolve(context)
File "/home/tim/code/django/django/template/base.py", line 739, in resolve
value = self._resolve_lookup(context)
File "/home/tim/code/django/django/template/base.py", line 769, in _resolve_lookup
current = current[bit]
IndexError: index 5 is out of bounds for axis 0 with size 2
Attachments (1)
Change History (6)
comment:1 by , 11 years ago
| Has patch: | set |
|---|
by , 11 years ago
| Attachment: | 23489.diff added |
|---|
comment:5 by , 11 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Here is the change in behavior:
NumPy < 1.9
NumPy 1.9+
Attaching a patch to fix it. I guess we shouldn't backport, but require specific version of test dependencies in Jenkins as suggested in #21793.
The original issue where these tests were added: [7d5e35cd].