diff options
author | Julian Taylor <jtaylor.debian@googlemail.com> | 2016-09-01 15:58:09 +0200 |
---|---|---|
committer | Julian Taylor <jtaylor.debian@googlemail.com> | 2016-09-01 16:11:25 +0200 |
commit | d555a0ad0f1191daf8ae83e10933da5556b2510e (patch) | |
tree | cfe1aa43b2e527ee7dd403f6990f4dcf5260cb51 /numpy/testing/utils.py | |
parent | fd298a341ddeb05c471c8dfc16f4cc641d08f8a7 (diff) | |
download | numpy-d555a0ad0f1191daf8ae83e10933da5556b2510e.tar.gz |
TST: fix inplace case of alignment data generator
Due to the lambdas used it didn't actually generate inplace cases.
Fix a few tests that now break due to assuming that the cases are always
out of place.
Also update some numbers to make it more likely to find issues like
loading from wrong array.
Diffstat (limited to 'numpy/testing/utils.py')
-rw-r--r-- | numpy/testing/utils.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/numpy/testing/utils.py b/numpy/testing/utils.py index c7f4a0aa7..9c432f3dc 100644 --- a/numpy/testing/utils.py +++ b/numpy/testing/utils.py @@ -1794,7 +1794,8 @@ def _gen_alignment_data(dtype=float32, type='binary', max_size=24): inp = lambda: arange(s, dtype=dtype)[o:] out = empty((s,), dtype=dtype)[o:] yield out, inp(), ufmt % (o, o, s, dtype, 'out of place') - yield inp(), inp(), ufmt % (o, o, s, dtype, 'in place') + d = inp() + yield d, d, ufmt % (o, o, s, dtype, 'in place') yield out[1:], inp()[:-1], ufmt % \ (o + 1, o, s - 1, dtype, 'out of place') yield out[:-1], inp()[1:], ufmt % \ @@ -1809,9 +1810,11 @@ def _gen_alignment_data(dtype=float32, type='binary', max_size=24): out = empty((s,), dtype=dtype)[o:] yield out, inp1(), inp2(), bfmt % \ (o, o, o, s, dtype, 'out of place') - yield inp1(), inp1(), inp2(), bfmt % \ + d = inp1() + yield d, d, inp2(), bfmt % \ (o, o, o, s, dtype, 'in place1') - yield inp2(), inp1(), inp2(), bfmt % \ + d = inp2() + yield d, inp1(), d, bfmt % \ (o, o, o, s, dtype, 'in place2') yield out[1:], inp1()[:-1], inp2()[:-1], bfmt % \ (o + 1, o, o, s - 1, dtype, 'out of place') |