From: Joshua Roesslein Date: Sat, 17 Aug 2013 05:28:55 +0000 (-0700) Subject: Setup tests for Travis. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c9da420373de607ecd8e88e652df5c9b48abbe44;p=tweepy.git Setup tests for Travis. - For pull requests use HTTP records to replay traffic. - For master use the encrypted oAuth keys like normal. --- diff --git a/.travis.yml b/.travis.yml index 18de21d..763d36b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,10 @@ --- -script: nosetests -v tests.test_api tests.test_streaming tests.test_cursors language: python +python: + - "2.7" +install: + - pip install -r test_requirements.txt +script: ./run_tests.sh env: global: - TWITTER_USERNAME="tweepytest" @@ -20,8 +24,4 @@ env: nKkytraqLGUm33K1GpwkjOyxACDHYw4GMvOGyDwVTX7VNwqxbkUojB7qXYoQ JjlEyFWS487IFteR87U9pt18qongJJIphaBdT9/lDVLsMWZ0Jh5ZLQfX+2jS aF2UwsrYkzBUMrqMqYCc2+X6CuswLEZTVXDAlNh+emvhxZ5faMI= -python: - - "2.7" -branches: - only: - - master + diff --git a/run_tests.sh b/run_tests.sh new file mode 100755 index 0000000..de2f210 --- /dev/null +++ b/run_tests.sh @@ -0,0 +1,7 @@ +#! /usr/bin/env bash + +if [[ $TRAVIS_SECURE_ENV_VARS == "false" ]]; then + USE_REPLAY=1 nosetests -v tests.test_api +else + nosetests -v tests.test_api tests.test_streaming tests.test_cursors +fi diff --git a/setup.py b/setup.py index 9014c58..0f99cb5 100644 --- a/setup.py +++ b/setup.py @@ -2,10 +2,6 @@ #from distutils.core import setup from setuptools import setup, find_packages from tweepy import __version__ -from pip.req import parse_requirements - -install_reqs = parse_requirements('requirements.txt') -reqs = [str(req.req) for req in install_reqs] setup(name="tweepy", version=__version__, @@ -15,6 +11,5 @@ setup(name="tweepy", author_email="tweepy@googlegroups.com", url="http://github.com/tweepy/tweepy", packages = find_packages(), - install_requires=reqs, keywords= "twitter library", zip_safe = True) diff --git a/requirements.txt b/test_requirements.txt similarity index 100% rename from requirements.txt rename to test_requirements.txt diff --git a/tests/config.py b/tests/config.py index bb0dd61..ac9f2ec 100644 --- a/tests/config.py +++ b/tests/config.py @@ -7,7 +7,7 @@ from httreplay.utils import filter_headers_key from tweepy.auth import OAuthHandler from tweepy.api import API -username = os.environ.get('TWITTER_USERNAME', '') +username = os.environ.get('TWITTER_USERNAME', 'tweepytest') oauth_consumer_key = os.environ.get('CONSUMER_KEY', '') oauth_consumer_secret = os.environ.get('CONSUMER_SECRET', '') oauth_token = os.environ.get('ACCESS_KEY', '')