summaryrefslogtreecommitdiff
path: root/numpy/testing/utils.py
diff options
context:
space:
mode:
authorPauli Virtanen <pav@iki.fi>2015-11-14 14:28:25 +0200
committerPauli Virtanen <pav@iki.fi>2015-11-14 14:28:25 +0200
commiteadc135a5f2ab577748188770af66feafe87859d (patch)
tree252fdf346b3cd5c211a2209e3176cb515afb010f /numpy/testing/utils.py
parentf83d68bdac7bf0843f1601da25ac51f97983b1ef (diff)
downloadnumpy-eadc135a5f2ab577748188770af66feafe87859d.tar.gz
BUG: testing: fix a bug in assert_string_equal
Diffstat (limited to 'numpy/testing/utils.py')
-rw-r--r--numpy/testing/utils.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/numpy/testing/utils.py b/numpy/testing/utils.py
index 099b75bdf..8a282ff3c 100644
--- a/numpy/testing/utils.py
+++ b/numpy/testing/utils.py
@@ -1018,11 +1018,12 @@ def assert_string_equal(actual, desired):
if not d2.startswith('+ '):
raise AssertionError(repr(d2))
l.append(d2)
- d3 = diff.pop(0)
- if d3.startswith('? '):
- l.append(d3)
- else:
- diff.insert(0, d3)
+ if diff:
+ d3 = diff.pop(0)
+ if d3.startswith('? '):
+ l.append(d3)
+ else:
+ diff.insert(0, d3)
if re.match(r'\A'+d2[2:]+r'\Z', d1[2:]):
continue
diff_list.extend(l)