6. Test Package#

You can test the package using either pytest or tox.

6.1. Test with pytest#

codecov-devel

The package can be tested by running several test scripts, which test all sub-packages and examples.

Clone the source code from the repository and install the required test packages by

git clone https://github.com/ameli/imate.git
cd imate
python -m pip install -r tests/requirements.txt
python -m pip install .

To automatically run all tests, use pytest which is installed by the above commands.

mv imate imate-do-not-import
pytest

Attention

To properly run pytest, rename /imate/imate directory as shown in the above code. This makes pytest to properly import imate from the installed location, not from the source code directory.

6.2. Test with tox#

To run a test in a virtual environment, use tox as follows:

  1. Clone the source code from the repository:

    git clone https://github.com/ameli/imate.git
    
  2. Install tox:

    python -m pip install tox
    
  3. Run tests by

    cd imate
    tox