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
test
extra, e.g.pip install .[test]
. Optionally install thedev
extra as well, fortox
andcoverage
, e.g.pip install .[dev,test]
.Run tests (e.g.
python -m unittest discover tests
) in the source directory. With thedev
extra, coverage can be measured by usingcoverage run
(e.g.coverage run -m unittest discover tests
) andtox
can 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.