From d555a0ad0f1191daf8ae83e10933da5556b2510e Mon Sep 17 00:00:00 2001 From: Julian Taylor Date: Thu, 1 Sep 2016 15:58:09 +0200 Subject: 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. --- numpy/testing/utils.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'numpy/testing/utils.py') 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') -- cgit v1.2.1