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

unittest.mock does not work on WebAssembly build of CPython #96883

Closed
treyhunner opened this issue Sep 17, 2022 · 2 comments
Closed

unittest.mock does not work on WebAssembly build of CPython #96883

treyhunner opened this issue Sep 17, 2022 · 2 comments
Labels
OS-wasi type-bug An unexpected behavior, bug, or error

Comments

@treyhunner
Copy link
Member

Bug report

Use CPython compiled for WebAssembly and then import unittest.mock

Or visit this page and click the "Run in Browser" button to see the error.

The error shown is:

Traceback (most recent call last):
  File "//__main__.py", line 2, in <module>
    import unittest.mock
  File "/home/runner/work/cpython-wasm-test/cpython-wasm-test/cpython/Lib/unittest/mock.py", line 26, in <module>
  File "/home/runner/work/cpython-wasm-test/cpython-wasm-test/cpython/Lib/asyncio/__init__.py", line 8, in <module>
  File "/home/runner/work/cpython-wasm-test/cpython-wasm-test/cpython/Lib/asyncio/base_events.py", line 18, in <module>
ModuleNotFoundError: No module named 'concurrent'

This error seems to only occur on the WebAssembly build for the browser (the Node build allows unittest.mock to be imported as expected).

Your environment

  • CPython versions tested on: 3.11.0rc2
  • Operating system and architecture: WebAssembly
@treyhunner treyhunner added the type-bug An unexpected behavior, bug, or error label Sep 17, 2022
tiran added a commit to tiran/cpython that referenced this issue Sep 17, 2022
tiran added a commit to tiran/cpython that referenced this issue Sep 17, 2022
tiran added a commit to tiran/cpython that referenced this issue Sep 17, 2022
…96886).

(cherry picked from commit 0b62964)

Co-authored-by: Christian Heimes <christian@python.org>
@brettcannon
Copy link
Member

@tiran can this issue be closed?

@treyhunner
Copy link
Member Author

Closing, as unittest.mock works for me now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-wasi type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants