Plastron uses the pytest test framework for its tests.
Ensure that you have installed all the packages with the [test]
extra,
as described in README § Install for development.
Run pytest:
pytest
The Plastron project also includes a tox.ini configuration file for running the test suite against multiple versions of Python. By default, it will test against Python 3.6, 3.7, 3.8, 3.9, and 3.10.
The recommended way to ensure you have all those versions available is to use pyenv to install the latest patch level of each of those minor versions. As of this writing, that would be:
pyenv install 3.6.15
pyenv install 3.7.13
pyenv install 3.8.13
pyenv install 3.9.13
pyenv install 3.10.5
Ensures that the python3.X
shims will all work by setting the local python
versions:
pyenv local 3.10.5 3.9.13 3.8.13 3.7.13 3.6.15
Install tox and the tox-pyenv plugin:
pip install tox tox-pyenv
Run tox
to test across multiple Python versions:
# use --recreate to create fresh virtualenvs
tox --recreate
To test against a single version of Python, supply an -e
argument:
# only test against Python 3.8
tox -e py38