pytest-pyodide 0.21.0a4
pip install pytest-pyodide==0.21.0a4
Released:
"Pytest plugin for testing Pyodide and third-party applications that use Pyodide"
Navigation
Verified details
These details have been verified by PyPIMaintainers
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: Mozilla Public License 2.0 (MPL 2.0)
- Author: Pyodide developers
- Requires: Python >=3.10
Classifiers
- Framework
- License
- Operating System
- Programming Language
Project description
pytest-pyodide
Pytest plugin for testing Pyodide and third-party applications that use Pyodide
Installation
pytest-pyodide requires Python 3.10+ and can be installed with
pip install pytest-pyodide
You would also one at least one of the following runtimes,
- Chrome and chromedriver
- Firefox and geckodriver
- node v14+
Usage
-
First you would need a compatible version of Pyodide. You can download the Pyodide build artifacts from releases with,
wget https://github.com/pyodide/pyodide/releases/download/0.21.0a3/pyodide-build-0.21.0a3.tar.bz2 tar xjf pyodide-build-0.21.0a3.tar.bz2 mv pyodide dist/
-
You can then use the provided fixtures (
selenium
,selenium_standalone
) in tests,def test_a(selenium): selenium.run("assert 1+1 == 2") # run Python with Pyodide
which you can run with
pytest --dist-dir=./dist/
-
For convenience, the
run_in_pyodide
decorator is also provided. For instance the above example would be equivalent to,from pytest_pyodide.decorator import run_in_pyodide @run_in_pyodide def test_a(selenium): assert 1+1 == 2
License
pytest-pyodide uses the Mozilla Public License Version 2.0.
Project details
Verified details
These details have been verified by PyPIMaintainers
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: Mozilla Public License 2.0 (MPL 2.0)
- Author: Pyodide developers
- Requires: Python >=3.10
Classifiers
- Framework
- License
- Operating System
- Programming Language
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pytest-pyodide-0.21.0a4.tar.gz
.
File metadata
- Download URL: pytest-pyodide-0.21.0a4.tar.gz
- Upload date:
- Size: 19.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f5cc0890f6658d0618d6db2fb948824939a8a6cd84fffea62c6a76dbe8c641e |
|
MD5 | dead823c8fb8710cab7f1756b7062093 |
|
BLAKE2b-256 | 540388b3b4547be00024f50fe2b326dfa4d51d753f09e4cbbb500e2677174cac |
File details
Details for the file pytest_pyodide-0.21.0a4-py3-none-any.whl
.
File metadata
- Download URL: pytest_pyodide-0.21.0a4-py3-none-any.whl
- Upload date:
- Size: 17.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2162f834f8c55df2b73ce9c14fcdf65318b614e4d207a9473b48593c300cfae4 |
|
MD5 | 2a7500a9379a1af70493b47ae443cf49 |
|
BLAKE2b-256 | 1aaed3ff92df4d04597a248e401d98d8cd3d7c050ce4ea9067a8d9bc41fe3187 |