[SciPy-Dev] adding test to test_random.py

Vincent Davis vincent@vincentdavis....
Sun Jun 13 20:38:58 CDT 2010


On Sun, Jun 13, 2010 at 7:20 PM, Robert Kern <robert.kern@gmail.com> wrote:
> On Sun, Jun 13, 2010 at 20:13, Vincent Davis <vincent@vincentdavis.net> wrote:
>> On Sun, Jun 13, 2010 at 7:07 PM, Robert Kern <robert.kern@gmail.com> wrote:
>>> On Sun, Jun 13, 2010 at 20:03, Vincent Davis <vincent@vincentdavis.net> wrote:
>>>> On Sun, Jun 13, 2010 at 6:36 PM, Robert Kern <robert.kern@gmail.com> wrote:
>>>>> On Sun, Jun 13, 2010 at 19:23, Vincent Davis <vincent@vincentdavis.net> wrote:
>>>>>> Thanks for the recommendations, how do I run the test in a more
>>>>>> verbose way. I am google how to do this now.
>>>>>
>>>>> np.test(verbose=2)
>>>>
>>>> The only test with random in it is
>>>> test_random (test_function_base.TestDigitize) ... ok
>>>> Which is not part of test_random.py file. ie I see no evidence that is
>>>> being run.
>>>>
>>>> So I assume I am still missing something ???
>>>
>>> Your methods are named "test_rand" and "test_randn". They don't have
>>> the string "random" in them.
>>
>> I should have been more clear I could not find , test_rand and
>> test_randn nor the test_gaussian_reset or other which are in the
>> original test_random.py file. I was searching  the output from running
>> np.random.test(verbose=2)
>
> If the methods have docstrings, those are printed instead of the name
> of the method.
>
> [~]$ python -c "import numpy;numpy.random.test(verbose=2)"
> Running unit tests for numpy.random
> NumPy version 1.4.0
> NumPy is installed in
> /Library/Frameworks/Python.framework/Versions/6.1/lib/python2.6/site-packages/numpy
> Python version 2.6.4 |EPD 6.1-1 (32-bit)| (r264:75706, Dec 11 2009,
> 10:58:54) [GCC 4.0.1 (Apple Inc. build 5465)]
> nose version 0.11.1
> test_basic (test_random.TestMultinomial) ... ok
> test_int_negative_interval (test_random.TestMultinomial) ... ok
> test_zero_probability (test_random.TestMultinomial) ... ok
> Make sure generated random variables are in [-pi, pi]. ... ok
> Test for ticket #921 ... ok
> Test for ticket #923 ... ok
> Make sure we can accept old state tuples that do not have the cached ... ok
> test_basic (test_random.TestSetState) ... ok
> Make sure the cached every-other-Gaussian is reset. ... ok
> When the state is saved with a cached Gaussian, make sure the cached ... ok
> Ensure that the negative binomial results take floating point ... ok
>
> ----------------------------------------------------------------------
> Ran 11 tests in 0.054s
>
> OK

It seems I have screwed something up. It works for the 32bit version
but not the 64bit I have been modifying. (see below). I guess I need
to spend more time investigating this.

Thanks again fro your time
Vincent

Python 2.6.5 |EPD 6.2-1 (32-bit)| (r265:79063, May 28 2010, 15:13:03)
[GCC 4.0.1 (Apple Inc. build 5488)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> np.random.test(verbose=2)
Running unit tests for numpy.random
NumPy version 1.4.0
NumPy is installed in
/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/site-packages/numpy
Python version 2.6.5 |EPD 6.2-1 (32-bit)| (r265:79063, May 28 2010,
15:13:03) [GCC 4.0.1 (Apple Inc. build 5488)]
nose version 0.11.3
test_basic (test_random.TestMultinomial) ... ok
test_int_negative_interval (test_random.TestMultinomial) ... ok
test_zero_probability (test_random.TestMultinomial) ... ok
Make sure generated random variables are in [-pi, pi]. ... ok
Test for ticket #921 ... ok
Test for ticket #923 ... ok
Make sure we can accept old state tuples that do not have the cached ... ok
test_basic (test_random.TestSetState) ... ok
Make sure the cached every-other-Gaussian is reset. ... ok
When the state is saved with a cached Gaussian, make sure the cached ... ok
Ensure that the negative binomial results take floating point ... ok

----------------------------------------------------------------------
Ran 11 tests in 0.040s

OK
<nose.result.TextTestResult run=11 errors=0 failures=0>
>
> --
> Robert Kern
>
> "I have come to believe that the whole world is an enigma, a harmless
> enigma that is made terrible by our own mad attempt to interpret it as
> though it had an underlying truth."
>  -- Umberto Eco
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
>


More information about the SciPy-Dev mailing list