This collection of functional tests depends on a mixture of Pexpect and pytest. pytest is used as a framework to run the entire collection and Pexpect is used to execute the CLI and make assertions on the output.
⚠️ To keep the tests cross-platform friendly, we use Pexpect'sPopenSpawninstead of the more heavily documentedspawn. See "Pexpect on Windows" for more details on the limitations.
- Python 3.x
- A built executable named
smartthings/smartthings.exeinstalled on the system PATH environment variable.
A good way to ensure the modules needed here don't interfere with other python projects you might have (and vice versa) is to use a virtual python environment for running tests. You can do this using the venv module.
cd smartthings-cli/packages/cli/functional-testspython -m pip install --upgrade pippip install -r requirements.txtpytest