diff options
author | Pauli Virtanen <pav@iki.fi> | 2015-11-14 14:28:25 +0200 |
---|---|---|
committer | Pauli Virtanen <pav@iki.fi> | 2015-11-14 14:28:25 +0200 |
commit | eadc135a5f2ab577748188770af66feafe87859d (patch) | |
tree | 252fdf346b3cd5c211a2209e3176cb515afb010f /numpy/testing/utils.py | |
parent | f83d68bdac7bf0843f1601da25ac51f97983b1ef (diff) | |
download | numpy-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.py | 11 |
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) |