Skip to content

Commit c9da420

Browse files
committed
Setup tests for Travis.
- For pull requests use HTTP records to replay traffic. - For master use the encrypted oAuth keys like normal.
1 parent 4da98de commit c9da420

File tree

5 files changed

+14
-12
lines changed

5 files changed

+14
-12
lines changed

.travis.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
---
2-
script: nosetests -v tests.test_api tests.test_streaming tests.test_cursors
32
language: python
3+
python:
4+
- "2.7"
5+
install:
6+
- pip install -r test_requirements.txt
7+
script: ./run_tests.sh
48
env:
59
global:
610
- TWITTER_USERNAME="tweepytest"
@@ -20,8 +24,4 @@ env:
2024
nKkytraqLGUm33K1GpwkjOyxACDHYw4GMvOGyDwVTX7VNwqxbkUojB7qXYoQ
2125
JjlEyFWS487IFteR87U9pt18qongJJIphaBdT9/lDVLsMWZ0Jh5ZLQfX+2jS
2226
aF2UwsrYkzBUMrqMqYCc2+X6CuswLEZTVXDAlNh+emvhxZ5faMI=
23-
python:
24-
- "2.7"
25-
branches:
26-
only:
27-
- master
27+

run_tests.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#! /usr/bin/env bash
2+
3+
if [[ $TRAVIS_SECURE_ENV_VARS == "false" ]]; then
4+
USE_REPLAY=1 nosetests -v tests.test_api
5+
else
6+
nosetests -v tests.test_api tests.test_streaming tests.test_cursors
7+
fi

setup.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
#from distutils.core import setup
33
from setuptools import setup, find_packages
44
from tweepy import __version__
5-
from pip.req import parse_requirements
6-
7-
install_reqs = parse_requirements('requirements.txt')
8-
reqs = [str(req.req) for req in install_reqs]
95

106
setup(name="tweepy",
117
version=__version__,
@@ -15,6 +11,5 @@
1511
author_email="tweepy@googlegroups.com",
1612
url="http://github.com/tweepy/tweepy",
1713
packages = find_packages(),
18-
install_requires=reqs,
1914
keywords= "twitter library",
2015
zip_safe = True)
File renamed without changes.

tests/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from tweepy.auth import OAuthHandler
88
from tweepy.api import API
99

10-
username = os.environ.get('TWITTER_USERNAME', '')
10+
username = os.environ.get('TWITTER_USERNAME', 'tweepytest')
1111
oauth_consumer_key = os.environ.get('CONSUMER_KEY', '')
1212
oauth_consumer_secret = os.environ.get('CONSUMER_SECRET', '')
1313
oauth_token = os.environ.get('ACCESS_KEY', '')

0 commit comments

Comments
 (0)