pyodide / pyodide/pytest-pyodide

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

Open
#92 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
38
Forks
20
Avg merge
1d 23h
Merged PRs (30d)
1

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with pytest_pyodide/decorator.py, where _decode raises when the Pyodide return value or exception cannot be unpickled, and compare it with packages/peewee/test_peewee.py and the failing test-packages--no-numpy-dependents job. Verify the failure reports a useful representation or traceback and that the browser package tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.