Running Tests¶
These steps outline how to run tests for Tweepy:
Download Tweepy’s source code to a directory.
Install from the downloaded source with the
testextra, e.g.pip install .[test]. Optionally install thedevextra as well, fortoxandcoverage, e.g.pip install .[dev,test].Run tests (e.g.
python -m unittest discover tests) in the source directory. With thedevextra, coverage can be measured by usingcoverage run(e.g.coverage run -m unittest discover tests) andtoxcan be run to test different Python versions.
To record new cassettes, the following environment variables can be used:
TWITTER_USERNAME
BEARER_TOKEN
CONSUMER_KEY
CONSUMER_SECRET
ACCESS_KEY
ACCESS_SECRET
USE_REPLAY
Simply set USE_REPLAY to False and provide the app and account
credentials and username.