From beb53457a865c7550a96efbf71b9f189130b0fca Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 21 Jun 2016 22:42:49 +0530 Subject: [PATCH] ... --- src/calibre/db/tests/main.py | 8 ++++---- src/calibre/ebooks/oeb/polish/tests/main.py | 10 +++++----- src/calibre/srv/tests/main.py | 9 ++++----- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/calibre/db/tests/main.py b/src/calibre/db/tests/main.py index 329f126580..ad45222038 100644 --- a/src/calibre/db/tests/main.py +++ b/src/calibre/db/tests/main.py @@ -9,10 +9,6 @@ __docformat__ = 'restructuredtext en' import unittest, os, argparse, time, functools, importlib -try: - import init_calibre # noqa -except ImportError: - pass def no_endl(f): @functools.wraps(f) @@ -100,6 +96,10 @@ def run_tests(find_tests=find_tests): r(verbosity=4).run(tests) if __name__ == '__main__': + try: + import init_calibre # noqa + except ImportError: + pass from calibre.utils.config_base import reset_tweaks_to_default from calibre.ebooks.metadata.book.base import reset_field_metadata reset_tweaks_to_default() diff --git a/src/calibre/ebooks/oeb/polish/tests/main.py b/src/calibre/ebooks/oeb/polish/tests/main.py index 81c76a68de..baf50959d4 100644 --- a/src/calibre/ebooks/oeb/polish/tests/main.py +++ b/src/calibre/ebooks/oeb/polish/tests/main.py @@ -7,11 +7,6 @@ __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal ' -try: - import init_calibre # noqa -except ImportError: - pass - import os, unittest, importlib def find_tests(): @@ -24,6 +19,11 @@ def find_tests(): return unittest.TestSuite(suits) if __name__ == '__main__': + try: + import init_calibre # noqa + except ImportError: + pass + from calibre.db.tests.main import run_tests run_tests(find_tests=find_tests) diff --git a/src/calibre/srv/tests/main.py b/src/calibre/srv/tests/main.py index 14767fb1b0..96c34a848a 100644 --- a/src/calibre/srv/tests/main.py +++ b/src/calibre/srv/tests/main.py @@ -8,11 +8,6 @@ __copyright__ = '2015, Kovid Goyal ' import unittest, os, argparse, time, functools, importlib -try: - import init_calibre - del init_calibre -except ImportError: - pass def no_endl(f): @functools.wraps(f) @@ -102,6 +97,10 @@ def run_tests(find_tests=find_tests): r(verbosity=4).run(tests) if __name__ == '__main__': + try: + import init_calibre # noqa + except ImportError: + pass from calibre.utils.config_base import reset_tweaks_to_default from calibre.ebooks.metadata.book.base import reset_field_metadata reset_tweaks_to_default()