Skip to content

Running Tests Locally#

Have you set up your local environment?

Make sure your local environment is set up by following the steps in the Setting Up the Local Environment guide.

There are two sets of tests that you can run locally: unit tests and integration tests. They are run separately, because the integration tests take a lot longer to run, and require credentials.

Running Unit Tests#

To run the unit tests, run the following command:

make test-unit

This command will run the unit tests and generate a coverage report in your terminal. You can also view the coverage report in your browser by opening the html report:

open htmlcov/index.html

Running Integration Tests#

Before running the integration tests, you need to set up your environment variables. You can do this by creating a .env file in the root of the repo and adding the following environment variables:

.env
PYTICKTICK_V1_CLIENT_ID="YOUR_CLIENT_ID"
PYTICKTICK_V1_CLIENT_SECRET="YOUR_CLIENT_SECRET"
PYTICKTICK_V1_TOKEN_VALUE="YOUR_TOKEN_UUID"
PYTICKTICK_V1_TOKEN_EXPIRATION=1111111111
PYTICKTICK_V2_USERNAME="YOUR_USERNAME"
PYTICKTICK_V2_PASSWORD="YOUR_PASSWORD"

If you don't want to create a .env file, you can set the same environment variables in your session before running the tests.

To run the integration tests, run the following command:

make test-integration

This command will run the integration tests and generate a coverage report in your terminal. You can also view the coverage report in your browser by opening the html report:

open htmlcov/index.html