The following works on cpython, but fails on pypy:

    import numpy as np
    def test_writeable():
        a = np.zeros((2,2), np.int8)
>       a.flags.writeable = False
E       TypeError: readonly attribute

So I went and installed pypy's fork of numpy from source, and tried to
start poking around looking for tests, etc. to see what was going on.

It looks like numpy/core/tests/test_multiarray.py
TestFlags.test_writeable is doing something similar, but when I
attempt to run the tests like so:

pypy -c "import numpy; numpy.test()"

(Is that the right way to do it?)

It looks like the only thing that gets referenced from the
test_multiarray.py file is:

======================================================================
ERROR: Failure: AttributeError ('module' object has no attribute 'datetime64')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/elis/venv/droidblue-pypy/site-packages/nose/loader.py",
line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/Users/elis/venv/droidblue-pypy/site-packages/nose/importer.py",
line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/Users/elis/venv/droidblue-pypy/site-packages/nose/importer.py",
line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File 
"/Users/elis/venv/droidblue-pypy/site-packages/numpy/core/tests/test_multiarray.py",
line 2712, in <module>
    class TestArgmax(TestCase):
  File 
"/Users/elis/venv/droidblue-pypy/site-packages/numpy/core/tests/test_multiarray.py",
line 2733, in TestArgmax
    ([np.datetime64('1923-04-14T12:43:12'),
AttributeError: 'module' object has no attribute 'datetime64'

(And this is after I have to comment out a bunch of imports that can't
be found, etc.)

My reading of this is that none of the tests in the test_multiarray.py
file are even being attempted due to a missing datetime64. Is that
correct?

Since we're not supposed to touch the numpy source if at all possible,
what's the suggested approach for getting the TestFlags tests to a
state where I can run them (besides just hacking away at the source
file, as it seems unlikely that would be an acceptable patch)? I'm not
certain if I'm going to be able to invest the time to fix the
writeable flag, but I'd like to give it a go, at least.

Anything else in particular I should be aware of, when it comes to flags, etc.?

Thanks,
Eli
_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to