Run unit tests by just invoking:
pytest
However, many tests are implemented as integration tests which require a local mastodon instance to be running.