diff --git a/.travis.yml b/.travis.yml index 0b26b9054c..86c1c126dd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,5 +6,6 @@ env: before_install: - curl https://download.calibre-ebook.com/travis/sw-linux.tar.xz | tar xJ -C $HOME + - python -c "from PyQt5.QtCore import QCoreApplication; print(QCoreApplication.libraryPaths())" - python setup.py bootstrap --ephemeral script: python setup.py test diff --git a/setup/test.py b/setup/test.py index 634b26f344..fc021d95d7 100644 --- a/setup/test.py +++ b/setup/test.py @@ -4,9 +4,10 @@ from __future__ import (unicode_literals, division, absolute_import, print_function) -import unittest +import unittest, os from setup import Command +is_travis = os.environ.get('TRAVIS') == 'true' TEST_MODULES = frozenset('srv db polish opf css docx cfi matcher icu smartypants build'.split()) @@ -78,8 +79,9 @@ class Test(Command): def run(self, opts): from calibre.utils.run_tests import run_cli, filter_tests_by_name - from calibre.gui2 import ensure_app - ensure_app() + if is_travis: + from calibre.gui2 import ensure_app + ensure_app() tests = find_tests(which_tests=frozenset(opts.test_module)) if opts.test_name: tests = filter_tests_by_name(tests, *opts.test_name)