On Tue, Sep 23, 2014 at 9:21 PM, Romu Hu <[email protected]> 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@localhost [tests (master)]$ nosetests <snip> ---------------------------------------------------------------------- Ran 379 tests in 12.457s OK Chuck
_______________________________________________ NumPy-Discussion mailing list [email protected] http://mail.scipy.org/mailman/listinfo/numpy-discussion
