Skip to content

Commit

Permalink
Run tests properly even if it's failing due to throttling.
Browse files Browse the repository at this point in the history
  • Loading branch information
ardydedase committed Jul 22, 2015
1 parent 55ff453 commit cde7dc9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ python:
install: pip install -r requirements.txt

# command to run tests, e.g. python setup.py test
script: python -m unittest tests.test_skyscanner
script: python runtests.py
19 changes: 19 additions & 0 deletions runtests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import unittest

testmodules = [
'tests.test_skyscanner'
]

suite = unittest.TestSuite()

for t in testmodules:
try:
# If the module defines a suite() function, call it to get the suite.
mod = __import__(t, globals(), locals(), ['suite'])
suitefn = getattr(mod, 'suite')
suite.addTest(suitefn())
except (ImportError, AttributeError):
# else, just load all the test cases from the module.
suite.addTest(unittest.defaultTestLoader.loadTestsFromName(t))

unittest.TextTestRunner().run(suite)

0 comments on commit cde7dc9

Please sign in to comment.