Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Tracked by #8
michaelweinold opened this issue Jun 8, 2023 · 1 comment

Comments

@michaelweinold
Copy link

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:

@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 michaelweinold changed the title build-packages-no-numpy-dependents Tests fail with "`ModuleNotFoundError. No module named ..." build-packages-no-numpy-dependents Tests fail with "ModuleNotFoundError. No module named ..." Jun 8, 2023
@ryanking13
Copy link
Member

Thanks for opening the issue! It would definitely be nice to show some better traceback when unpickling fails.

For now, you can directly use the selenium fixture in your tests to prevent unpickle errors and see the actual error message.

For example, you can replace @run_in_pyodide decorator with:

@run_in_pyodide
def test_blah(selenium):
    do_some_test()
def test_blah(selenium):
    selenium.run(
    """
    do_some_test()
    """
    )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants