Skip to content

Commit

Permalink
Setup tests for Travis.
Browse files Browse the repository at this point in the history
- For pull requests use HTTP records to replay traffic.
- For master use the encrypted oAuth keys like normal.
  • Loading branch information
joshthecoder committed Aug 17, 2013
1 parent 4da98de commit c9da420
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -20,8 +24,4 @@ env:
nKkytraqLGUm33K1GpwkjOyxACDHYw4GMvOGyDwVTX7VNwqxbkUojB7qXYoQ
JjlEyFWS487IFteR87U9pt18qongJJIphaBdT9/lDVLsMWZ0Jh5ZLQfX+2jS
aF2UwsrYkzBUMrqMqYCc2+X6CuswLEZTVXDAlNh+emvhxZ5faMI=
python:
- "2.7"
branches:
only:
- master
7 changes: 7 additions & 0 deletions run_tests.sh
Original file line number Diff line number Diff line change
@@ -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
5 changes: 0 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__,
Expand All @@ -15,6 +11,5 @@
author_email="[email protected]",
url="http://github.com/tweepy/tweepy",
packages = find_packages(),
install_requires=reqs,
keywords= "twitter library",
zip_safe = True)
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
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', '')
Expand Down

0 comments on commit c9da420

Please sign in to comment.