[Numpy-discussion] unittest for np.random.poisson with lambda=0
Wed Nov 11 23:15:20 CST 2009
Sebastian Haase wrote:
> Thanks Robert,
> Just for the archive: I hope the problem I was thinking of is what is
> referred to here:
> i.e. it should have been fixed as bug #1123145 in Numeric.
> (see also here:
> I still haven't learned how to write unittests .... (sorry)
That's very easy. Assuming you have a new random generator foo which
should always return one, it may be as easy as writing:
from numpy.random import foo
assert foo() == 1
In numpy/random/test_random. You can follow the nose doc (or other unit
tests) for more complex examples.
If you are unsure about how to write something, just create an issue to
numpy trac with a patch, and regularly bother us until we review it.
More information about the NumPy-Discussion