← Back to team overview

larry-discuss team mailing list archive

Re: [Blueprint simplify-unit-testing] Create a larry specific assert function to simplify unit testing

 

On Thu, Feb 4, 2010 at 2:45 PM,  <josef.pktd@xxxxxxxxx> wrote:
> something strange till later
>
>>>> y = larry([2.0,2.0,3.0], [['a', 'b', 'c']])
>>>> yc = y.copy()
>>>> assert_larry_equal(y, y, 'identity', original=yc, noreference=True)
> Traceback (most recent call last):
>  File "<pyshell#32>", line 1, in <module>
>    assert_larry_equal(y, y, 'identity', original=yc, noreference=True)
>  File "C:\Josef\eclipsegworkspace\larry-josef\larry-josef\la\util\testing.py",
> line 54, in assert_larry_equal
>    raise AssertionError, msg
> AssertionError:
>
> ---------------
> REFERENCE FOUND
> ---------------

That was a bug in the new assert_larry_equal code. I fixed it by changing

assert_(assert_noreference(actual, original))

to

assert_noreference(actual, original)

And the same with nocopy.

Now I get:

>> from la import larry
>> y = larry([2.0,2.0,3.0], [['a', 'b', 'c']])
>> yc = y.copy()
>> la.util.testing.assert_larry_equal(y, y, 'identity', original=yc, noreference=True)
>>



References