pytest-pyodide icon indicating copy to clipboard operation
pytest-pyodide copied to clipboard

`build-packages-no-numpy-dependents` Tests fail with "`ModuleNotFoundError. No module named ...`"

Open michaelweinold opened this issue 1 year ago • 1 comments

The Circle CI tests test-packages-<browser>-no-numpy-dependents fail with the error:

=================================== FAILURES ===================================
_____________________________ test_peewee[chrome] ______________________________
/usr/local/lib/python3.11/site-packages/pytest_pyodide/decorator.py:107: in _decode
    raise ModuleNotFoundError(
E   ModuleNotFoundError: There was a problem with unpickling the return value/exception from your pyodide environment. This usually means the type of the return value does not exist in your host environment. The original message is: No module named 'peewee'.
---------------------------- Captured stdout setup -----------------------------
Spawning webserver at http://127.0.0.1:54469 (see logs in /tmp/tmp6kk1q8i1/http-server.log)
--------------------------- Captured stdout teardown ---------------------------
Loading peewee, cffi, pycparser, pytest, atomicwrites, attrs, six, more-itertools, pluggy, py, setuptools, distutils, pyparsing, iniconfig, exceptiongroup, tblib
Loaded atomicwrites, pycparser, six, attrs, more-itertools, pluggy, py, distutils, pyparsing, iniconfig, exceptiongroup, tblib, cffi, setuptools, pytest, peewee
pyodide.isPyProxy() is deprecated. Use `instanceof pyodide.ffi.PyProxy` instead.
------------ generated xml file: /root/repo/test-results/junit.xml -------------
============================= slowest 50 durations =============================
2.76s setup    packages/peewee/test_peewee.py::test_peewee[chrome]
1.31s call     packages/peewee/test_peewee.py::test_peewee[chrome]
0.22s teardown packages/peewee/test_peewee.py::test_peewee[chrome]
=========================== short test summary info ============================
FAILED peewee/test_peewee.py::peewee[chrome] - ModuleNotFoundError: There was a problem with unpickling the return value/exception from your pyodide environment. This usually means the type of the return value does not exist in your host environment. The original message is: No module named 'peewee'.
============================== 1 failed in 4.93s ===============================

This presently affects this pull request:

  • https://github.com/pyodide/pyodide/pull/3897

@hoodmane's suggestion from the above PR thread:

@ryanking13 we could probably update pytest_pyodide to try to create something with a sane repr/traceback when it fails to unpickle an error. Since it's pretty rare that people define exceptions with a custom reduce.

michaelweinold avatar Jun 08 '23 04:06 michaelweinold