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
Support running non-pyodide tests in pyodide automatically? #58
Comments
I am not sure I understood your proposal correctly. If the package contains test files then if those can be run with pytest or unittest, you can run it with pytest and unittest APIs (example). Is this what you are looking for? |
I guess that is kind of almost what I'm looking for. It would be nice to have an easy way to automate it though - for example take ultrajson ( https://github.com/ultrajson/ultrajson which I've got a PR for wasm compatibility in), it has a tests folder outside the module itself. In the CI it runs all tests. It would be nice to have an option in pytest-pyodide to spin up a pyodide instance, copy the tests folder across and call pytest in that. That way at least in theory, the only change needed to get pyodide added to CI would be to add the pytest-pyodide workflow to the CI. I guess now I know pytest works inside pyodide, the functionality I'm looking for here is:
|
This is related to my command line runner. The idea there is that you make a special virtual environment, install the dependencies, and then run |
Wow, I like that python runner. Any way to make it work as a browser test as well as node though? Or would it be easier to add code to pytest-pyodide to do the equivalent (e.g. add an extra tool script which copies things to the pyodide installation and runs pytest) |
PR for this issue is in #62 |
Looking at porting libraries to work with webassembly, it would be nice to have a 'run the library tests in pyodide' option.
e.g. an option to pytest which instead of running all tests in pytest_pyodide and requiring e.g. selenium objects etc. it would instead install the package and run all tests found on a pyodide instance.
Otherwise I'm implementing separate test fixtures for pyodide tests, which essentially copy everything across to pyodide, import the package, then run the tests.
The text was updated successfully, but these errors were encountered: