How to Use Pytest

Pytest is a mature full-featured testing tool for Python. It is useful when developing Python scripts. Pytest is not installed in the ADS Python installation.

The recommended steps to use Pytest are:

  1. Create a Python virtual environment. See How to Set Up a Python Virtual Environment.

  2. Activate the Python virtual environment.

  3. Install pytest into the virtual environment.

    pip install pytest
    
  4. Run pytest on your test scripts.

    cd path/to/tests
    pytest
    
On this page