[Numpy-discussion] All numpy-f2py tests failed

Charles R Harris charlesr.harris at gmail.com
Wed Sep 24 00:30:55 EDT 2014


On Tue, Sep 23, 2014 at 10:20 PM, Charles R Harris <
charlesr.harris at gmail.com> wrote:

>
>
> On Tue, Sep 23, 2014 at 9:21 PM, Romu Hu <huruomu at gmail.com> wrote:
>
>> Hi,
>>
>> I'm using python27-numpy-f2py-1.7.1-9.el6.x86_64 from RHEL6, the package
>> has a test directory
>> "/usr/lib64/python2.7/site-packages/numpy/f2py/tests", when I run
>> unittest in the directory, all 358 testcases fail:
>>
>> # cd /usr/lib64/python2.7/site-packages/numpy/f2py/tests
>> # python27 -m unittest discover -v
>>
>> ======================================================================
>> ERROR: test_c_copy_in_from_23casttype
>> (test_array_from_pyobj.test_BOOL_gen)
>> ----------------------------------------------------------------------
>> Traceback (most recent call last):
>>    File "<string>", line 5, in setUp
>>    File
>>
>> "/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/f2py/tests/test_array_from_pyobj.py",
>> line 126, in __new__
>>      obj._init(name)
>>    File
>>
>> "/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/f2py/tests/test_array_from_pyobj.py",
>> line 132, in _init
>>      self.type_num = getattr(wrap,'NPY_'+self.NAME)
>> AttributeError: 'NoneType' object has no attribute 'NPY_BOOL'
>>
>> ======================================================================
>> ERROR: test_c_in_from_23casttype (test_array_from_pyobj.test_BOOL_gen)
>> ----------------------------------------------------------------------
>> Traceback (most recent call last):
>>    File "<string>", line 5, in setUp
>>    File
>>
>> "/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/f2py/tests/test_array_from_pyobj.py",
>> line 126, in __new__
>>      obj._init(name)
>>    File
>>
>> "/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/f2py/tests/test_array_from_pyobj.py",
>> line 132, in _init
>>      self.type_num = getattr(wrap,'NPY_'+self.NAME)
>> AttributeError: 'NoneType' object has no attribute 'NPY_BOOL'
>>
>> ......
>> ......
>>
>> ======================================================================
>> ERROR: test_optional_from_23seq (test_array_from_pyobj.test_USHORT_gen)
>> ----------------------------------------------------------------------
>> Traceback (most recent call last):
>>    File "<string>", line 5, in setUp
>>    File
>>
>> "/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/f2py/tests/test_array_from_pyobj.py",
>> line 126, in __new__
>>      obj._init(name)
>>    File
>>
>> "/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/f2py/tests/test_array_from_pyobj.py",
>> line 132, in _init
>>      self.type_num = getattr(wrap,'NPY_'+self.NAME)
>> AttributeError: 'NoneType' object has no attribute 'NPY_USHORT'
>>
>> ======================================================================
>> ERROR: test_optional_from_2seq (test_array_from_pyobj.test_USHORT_gen)
>> ----------------------------------------------------------------------
>> Traceback (most recent call last):
>>    File "<string>", line 5, in setUp
>>    File
>>
>> "/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/f2py/tests/test_array_from_pyobj.py",
>> line 126, in __new__
>>      obj._init(name)
>>    File
>>
>> "/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/f2py/tests/test_array_from_pyobj.py",
>> line 132, in _init
>>      self.type_num = getattr(wrap,'NPY_'+self.NAME)
>> AttributeError: 'NoneType' object has no attribute 'NPY_USHORT'
>>
>> ======================================================================
>> ERROR: test_optional_none (test_array_from_pyobj.test_USHORT_gen)
>> ----------------------------------------------------------------------
>> Traceback (most recent call last):
>>    File "<string>", line 5, in setUp
>>    File
>>
>> "/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/f2py/tests/test_array_from_pyobj.py",
>> line 126, in __new__
>>      obj._init(name)
>>    File
>>
>> "/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/f2py/tests/test_array_from_pyobj.py",
>> line 132, in _init
>>      self.type_num = getattr(wrap,'NPY_'+self.NAME)
>> AttributeError: 'NoneType' object has no attribute 'NPY_USHORT'
>>
>> ======================================================================
>> ERROR: test_in_out (test_array_from_pyobj.test_intent)
>> ----------------------------------------------------------------------
>> Traceback (most recent call last):
>>    File
>>
>> "/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/f2py/tests/test_array_from_pyobj.py",
>> line 270, in test_in_out
>>      assert_equal(str(intent.in_.out),'intent(in,out)')
>>    File
>>
>> "/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/f2py/tests/test_array_from_pyobj.py",
>> line 67, in __getattr__
>>      return self.__class__(self.intent_list+[name])
>>    File
>>
>> "/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/f2py/tests/test_array_from_pyobj.py",
>> line 62, in __init__
>>      flags |= getattr(wrap,'F2PY_INTENT_'+i.upper())
>> AttributeError: 'NoneType' object has no attribute 'F2PY_INTENT_IN'
>>
>> ----------------------------------------------------------------------
>> Ran 358 tests in 0.047s
>>
>> FAILED (errors=358)
>>
>>
>> It seems that all tests fail because the 'wrap' variable is None. Am I
>> using a wrong way to run the tests?  Any idea?
>>
>>
> Looks pretty drastic, but I expect the problem is that numpy uses nose for
> running tests, not unittest. Try
>
> charris at localhost [tests (master)]$ nosetests
>
> <snip>
>
> ----------------------------------------------------------------------
> Ran 379 tests in 12.457s
>
> OK
>
> But this doesn't work with the installed package. From ipython, or a
terminal, do

In [8]: np.f2py.test()
Running unit tests for numpy.f2py
NumPy version 1.10.0.dev-4083883
NumPy is installed in /home/charris/.local/lib/python2.7/site-packages/numpy
Python version 2.7.5 (default, Jun 25 2014, 10:19:55) [GCC 4.8.2 20131212
(Red Hat 4.8.2-7)]
nose version 1.3.0
.......................................................................................................................................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 359 tests in 1.737s

OK

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20140923/8da33bfb/attachment.html>


More information about the NumPy-Discussion mailing list