File size: 1,640 Bytes
065fee7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
Running Unit Tests
==================
Unit tests are located in the ``tests`` directory.
To test both the pure Python and C extension module based implementations,
run the command:
::
tox
By default tests are run for Python 2.7, 3.5-3.9 and PyPy, with and
without the C extensions.
::
py27-without-extensions
py35-without-extensions
py36-without-extensions
py37-without-extensions
py38-without-extensions
py39-without-extensions
py27-install-extensions
py35-install-extensions
py36-install-extensions
py37-install-extensions
py38-install-extensions
py39-install-extensions
py27-disable-extensions
py35-disable-extensions
py36-disable-extensions
py37-disable-extensions
py38-disable-extensions
py39-disable-extensions
pypy-without-extensions
If wishing to run tests for a specific Python combination you can run
``tox`` with the ``-e`` option.
::
tox -e py39-install-extensions
If adding more tests and you need to add a test which is Python 2 or
Python 3 specific, then end the name of the Python code file as
``_py2.py`` or ``_py3.py`` appropriately.
For further options refer to the documentation for ``tox``.
Coverage
--------
Coverage is collected and sent to `Coveralls <https://coveralls.io>`_ when
running the tests automatically in `GitHub Actions <https://github.com/GrahamDumpleton/wrapt/actions>`_.
To collect and view coverage results locally, here's the sequence of
commands:
::
tox
coverage combine
coverage html --ignore-errors
At this point there's a directly called ``htmlcov`` with the formatted
results.
|