From 1d41a638eee3232a599e64a0b5a89b3269d373d7 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 13 Sep 2014 11:51:03 +0800 Subject: [PATCH] Update .travis.yml, fix imports and tests --- .travis.yml | 11 ++++------- sickbeard/__init__.py | 2 ++ tests/all_tests.py | 5 +++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 63180c38..5482a807 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,11 +4,8 @@ python: - 2.6 - 2.7 -# whitelist -branches: - only: - - ThePirateBay - - Pistachitos - +install: + - pip install cheetah + before_script: cd ./tests -script: ./all_tests.py \ No newline at end of file +script: python all_tests.py \ No newline at end of file diff --git a/sickbeard/__init__.py b/sickbeard/__init__.py index 682ae1ab..ab53c01c 100755 --- a/sickbeard/__init__.py +++ b/sickbeard/__init__.py @@ -28,6 +28,8 @@ from threading import Lock # apparently py2exe won't build these unless they're imported somewhere import sys +import os.path +sys.path.append(os.path.abspath('../lib')) from sickbeard import providers, metadata, config, webserveInit from sickbeard.providers.generic import GenericProvider from providers import ezrss, tvtorrents, btn, newznab, womble, thepiratebay, torrentleech, kat, iptorrents, \ diff --git a/tests/all_tests.py b/tests/all_tests.py index b3b590e4..dfe63c9e 100644 --- a/tests/all_tests.py +++ b/tests/all_tests.py @@ -21,13 +21,13 @@ if __name__ == "__main__": import glob import unittest + import sys test_file_strings = [ x for x in glob.glob('*_tests.py') if not x in __file__] module_strings = [file_string[0:len(file_string) - 3] for file_string in test_file_strings] suites = [unittest.defaultTestLoader.loadTestsFromName(file_string) for file_string in module_strings] testSuite = unittest.TestSuite(suites) - print "==================" print "STARTING - ALL TESTS" print "==================" @@ -35,5 +35,6 @@ if __name__ == "__main__": for includedfiles in test_file_strings: print "- " + includedfiles - text_runner = unittest.TextTestRunner().run(testSuite) + if not text_runner.wasSuccessful(): + sys.exit(-1)