Setup tests for Travis.
authorJoshua Roesslein <jroesslein@gmail.com>
Sat, 17 Aug 2013 05:28:55 +0000 (22:28 -0700)
committerJoshua Roesslein <jroesslein@gmail.com>
Sat, 17 Aug 2013 05:28:55 +0000 (22:28 -0700)
- For pull requests use HTTP records to replay traffic.
- For master use the encrypted oAuth keys like normal.

.travis.yml
run_tests.sh [new file with mode: 0755]
setup.py
test_requirements.txt [moved from requirements.txt with 100% similarity]
tests/config.py

index 18de21d8b380381dea6d42cfdf3b4da00685a6b4..763d36bd6890c94f975810bf7c1536fbaabc7746 100644 (file)
@@ -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 (executable)
index 0000000..de2f210
--- /dev/null
@@ -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
index 9014c585ebcc6c5e20f115e8e64d77cda71f816c..0f99cb5d542940e96190fee6699637ca15835edd 100644 (file)
--- 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)
similarity index 100%
rename from requirements.txt
rename to test_requirements.txt
index bb0dd61c5ffb4f3c8b1996b6a9893e2eb13bd39f..ac9f2ecc02ce89ddcf4ccdef7b7e22e3a3b07c63 100644 (file)
@@ -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', '')