Unit and integration tests for iexfinance are handled by the pytest platform.


Use of the Sandbox Environment is required when running the test suite.

Testing & Documentation Dependencies


  • pytest
  • pytest-runner
  • flake8
  • flake8-rst
  • requests-cache
  • six


  • sphinx
  • sphinx-autobuild
  • sphinx-rtd-theme
  • sphinxcontrib-napoleon
  • matplotlib
  • ipython

Sandbox Environment

IEX provides a sandbox environment for IEX Cloud. This environment can be accessed by setting IEX_API_VERSION to iexcloud-sandbox. This will set iexfinance up for use with the sandbox base URL.


Test keys (beginning with Tsk and Tpk) must be used with the sandbox environment. To obtain these keys, select the “Viewing test data” toggler on the left side of the IEX Cloud console.

Local Testing

We’ve provided the BASH script test.sh which is included in the top-level iexfinance directory. This script will emulate the tests needed for a TravisCI build to pass.

Docs can be tested with Sphinx (with extensions napoleon and sphinx_rtd_theme) using the Makefile. make livehtml will serve the dev documentation site locally on

Test Weighting

Many tests which have a data weighting of over 1000 total are marked highweight.


exception iexfinance.utils.exceptions.IEXAuthenticationError(msg)

This error is thrown when there is an authentication issue with an IEX cloud request.

exception iexfinance.utils.exceptions.IEXEndpointError(endpoint)

This error is thrown when an invalid endpoint is specified in the custom endpoint lookup method

exception iexfinance.utils.exceptions.IEXFieldError(endpoint, field)

This error is thrown when an invalid field is specified in the custom endpoint lookup method

exception iexfinance.utils.exceptions.IEXQueryError

This error is thrown when an error occurs with the query to IEX, be it a network problem or an invalid query.

exception iexfinance.utils.exceptions.IEXSymbolError(symbol)

This error is thrown when an invalid symbol is given.

exception iexfinance.utils.exceptions.ImmediateDeprecationError

Release Procedure