From 9c1498d4ca6e5d6401a713c7086e5cfe2585942b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 24 Jun 2016 23:09:06 +0530 Subject: [PATCH] As best as I can tell from reading Qt sourcecode, as long as QT_PLUGIN_PATH is set, it should just work. So only call ensure_app() on travis and nowhere else --- .travis.yml | 1 + setup/test.py | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) 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)