← 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 Wed, Feb 3, 2010 at 6:06 PM, joep <josef.pktd@xxxxxxxxx> wrote:
> Blueprint changed by joep:
>
> Whiteboard set to:
>
> assert_larry
> http://bazaar.launchpad.net/~kwgoodman/larry/trunk/annotate/head%3A/la/tests/deflarry_nose_test.py#L49
>
> and the method check_function in test class
>
> http://bazaar.launchpad.net/~kwgoodman/larry/trunk/annotate/head%3A/la/tests/deflarry_nose_test.py#L128
>
> already contain the extracted boiler plate assert function to compare a
> larry with desired data matrix x and labels
>
> the later has a view keyword to choose whether to verify nocopy or
> noreference
>
> used in nosetests for larry methods

I moved this to the larry-discuss list since it is hard to discuss it
through the whiteboard on the blueprint.

Yes, let's start with those functions and then prettify them.

What should the signature be?

The current signature is:

assert_larry(opname, la, t, lab, msgstr)

How about changing that to the same signature as np.testing.assert_equal? So:

assert_equal(actual, desired, err_msg='', verbose=True)

Then we don't have to separate the data and the label. And instead of
nancode we can use the numpy nan aware assert in numpy 1.4.

Oops...dinner time!



Follow ups