pytest-pyodide
pytest-pyodide copied to clipboard
coverage support
I cannot work out if there's any way to use coverage with this?
If not, it would be great if there was a way - we have coverage available in pyodide, so it is basically a case of adding coverage calls, and some way of bringing them back into the containing environment.
Do you mean adding a coverage report for code that runs inside Pyodide? There is an issue about it (https://github.com/pyodide/pyodide/issues/2873), but I think nobody tried to implement it.
some way of bringing them back into the containing environment.
This will be the most tricky part I guess. I would appreciate it if you could do some experiment to see if it is possible.
@ryanking13 I did this manually in urllib3 ci - it works like: load coverage, run python code, return the coverage data. I don't know if it is worth implementing in pytest-pyodide more generally.
Cool. We can probably support something more general: extracting the file inside the Pyodide filesystem to the host, which can be used for coverage file as well.