-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Tests always pass no matter what. #81
Comments
I've spent some more time digging into this problem and focussed on this function. As far as I can tell there are several problems:
<?xml version="1.0" encoding="utf-8"?>
<testsuites>
<testsuite name="pytest" errors="0" failures="0" skipped="0" tests="0" time="0.021" timestamp="2023-03-09T13:02:59.376000" hostname="emscripten" />
</testsuites>
<?xml version="1.0" encoding="utf-8"?>
<testsuites>
<testsuite name="pytest" errors="1" failures="0" skipped="0" tests="1" time="0.197" timestamp="2023-03-09T14:08:39.361000" hostname="emscripten">
<testcase classname="" name="test_files.tests.test_my_module" time="0.000">
<error message="collection failure">ImportError while importing test module \'/home/pyodide/test_files/tests/test_my_module.py\'.\nHint: make sure your test modules/packages have valid Python names.\nTraceback:\n/lib/python3.10/importlib/__init__.py:126: in import_module\n return _bootstrap._gcd_import(name[level:], package, level)\ntest_files/tests/test_my_module.py:1: in <module>\n import my_module\nE ModuleNotFoundError: No module named \'my_module\'</error>
</testcase>
</testsuite>
</testsuites> Not sure what to suggest - but something is definitely amiss: only the test module is copied over, and it's not referenced properly when calling |
I guess the solution for now is to make a wheel. |
🤣 yeah ☸️ 👍 All part of the fun. |
Make a wheel (and then document / script the process) |
It would be great to fix pytest-pyodide so that it is not required to build a wheel for pure Python libs though. |
Hi,
Thank you for pytest-pyodide.
Context: I'm trying to run some "normal" tests inside Pyodide with PyTest and Chrome.
Problem: no matter what I put into the test functions (e.g.
assert False
), they always pass.Example: I've created a repository with a bare minimum reproduction of the problem: https://github.com/ntoll/borked Just follow the instructions in the README and
make test
.When I run the tests without
--run-in-pyodide
they fail as expected. Help?!?! cc/ @hoodmaneThe text was updated successfully, but these errors were encountered: