Discussion:
[Numpy-discussion] test_closing_fid (in test_io.py) on PyPy
Matti Picus
2016-08-05 07:06:02 UTC
Permalink
test_closing_fid essentially calls this to ensure close() is called when
a NpzFile object goes out of context:

for i in range(1, 1025):

np.load(tmp)["data"]


This raises a ResourceWarning on python 3, and fails on pypy since the
garbage collector works differently.

It seems to be a classic example of wrongly using np.load(), but I'm
sure it is a common use case.

I can submit a pull request to skip on pypy, or should this be solved in
a more substantial way?

Matti
Pauli Virtanen
2016-08-05 17:35:44 UTC
Permalink
Fri, 05 Aug 2016 10:06:02 +0300, Matti Picus kirjoitti:
[clip]
Post by Matti Picus
I can submit a pull request to skip on pypy, or should this be solved in
a more substantial way?
Should also be safe to just skip it on Pypy, it's testing that the wrong
way to use np.load also works on CPython.
--
Pauli Virtanen
Loading...