diff --git a/tests/functional/__init__.py b/tests/functional/__init__.py index bb8d97f15..cec1fad4f 100644 --- a/tests/functional/__init__.py +++ b/tests/functional/__init__.py @@ -22,7 +22,6 @@ """ Base directory for tests """ -import sys from PyQt5 import QtWidgets # Only one QApplication can be created. Use QtWidgets.QApplication.instance() when you need to "create" a QApplication. diff --git a/tests/functional/openlp_core/api/test_tab.py b/tests/functional/openlp_core/api/test_tab.py index a4c61082d..d70872919 100644 --- a/tests/functional/openlp_core/api/test_tab.py +++ b/tests/functional/openlp_core/api/test_tab.py @@ -28,9 +28,9 @@ from unittest.mock import patch from PyQt5 import QtWidgets +from openlp.core.api.tab import ApiTab from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings -from openlp.core.api.tab import ApiTab from tests.helpers.testmixin import TestMixin __default_settings__ = { diff --git a/tests/functional/openlp_core/api/test_websockets.py b/tests/functional/openlp_core/api/test_websockets.py index 7da90123d..a480056e3 100644 --- a/tests/functional/openlp_core/api/test_websockets.py +++ b/tests/functional/openlp_core/api/test_websockets.py @@ -25,10 +25,10 @@ Functional tests to test the Http Server Class. from unittest import TestCase from unittest.mock import MagicMock, patch +from openlp.core.api.poll import Poller +from openlp.core.api.websockets import WebSocketServer from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings -from openlp.core.api.websockets import WebSocketServer -from openlp.core.api.poll import Poller from tests.helpers.testmixin import TestMixin __default_settings__ = { diff --git a/tests/functional/openlp_core/common/test_actions.py b/tests/functional/openlp_core/common/test_actions.py index 7d5ac6fca..2c0cf9666 100644 --- a/tests/functional/openlp_core/common/test_actions.py +++ b/tests/functional/openlp_core/common/test_actions.py @@ -29,7 +29,6 @@ from PyQt5 import QtGui, QtCore, QtWidgets from openlp.core.common.actions import CategoryActionList, ActionList from openlp.core.common.settings import Settings - from tests.helpers.testmixin import TestMixin diff --git a/tests/functional/openlp_core/common/test_httputils.py b/tests/functional/openlp_core/common/test_httputils.py index b7c08993f..a815b1788 100644 --- a/tests/functional/openlp_core/common/test_httputils.py +++ b/tests/functional/openlp_core/common/test_httputils.py @@ -29,7 +29,6 @@ from unittest.mock import MagicMock, patch from openlp.core.common.httputils import get_user_agent, get_web_page, get_url_file_size, url_get_file from openlp.core.common.path import Path - from tests.helpers.testmixin import TestMixin diff --git a/tests/functional/openlp_core/common/test_init.py b/tests/functional/openlp_core/common/test_init.py index 9965a07ee..83f0c1c7c 100644 --- a/tests/functional/openlp_core/common/test_init.py +++ b/tests/functional/openlp_core/common/test_init.py @@ -22,15 +22,13 @@ """ Functional tests to test the AppLocation class and related methods. """ -import os from io import BytesIO from unittest import TestCase from unittest.mock import MagicMock, PropertyMock, call, patch -from openlp.core.common import add_actions, clean_filename, delete_file, get_file_encoding, get_filesystem_encoding, \ +from openlp.core.common import add_actions, clean_filename, delete_file, get_file_encoding, get_filesystem_encoding, \ get_uno_command, get_uno_instance from openlp.core.common.path import Path - from tests.helpers.testmixin import TestMixin diff --git a/tests/functional/openlp_core/common/test_json.py b/tests/functional/openlp_core/common/test_json.py index 18cba3b4e..a049f4a85 100644 --- a/tests/functional/openlp_core/common/test_json.py +++ b/tests/functional/openlp_core/common/test_json.py @@ -26,8 +26,8 @@ import json from unittest import TestCase from unittest.mock import patch -from openlp.core.common.path import Path from openlp.core.common.json import OpenLPJsonDecoder, OpenLPJsonEncoder +from openlp.core.common.path import Path class TestOpenLPJsonDecoder(TestCase): diff --git a/tests/functional/openlp_core/common/test_projector_utilities.py b/tests/functional/openlp_core/common/test_projector_utilities.py index 5a3f886cf..286783e67 100644 --- a/tests/functional/openlp_core/common/test_projector_utilities.py +++ b/tests/functional/openlp_core/common/test_projector_utilities.py @@ -26,7 +26,6 @@ Package to test the openlp.core.ui.projector.networkutils package. from unittest import TestCase from openlp.core.common import verify_ip_address, md5_hash, qmd5_hash - from tests.resources.projector.data import TEST_PIN, TEST_SALT, TEST_HASH salt = TEST_SALT diff --git a/tests/functional/openlp_core/common/test_settings.py b/tests/functional/openlp_core/common/test_settings.py index 4cad58af0..977a9e73d 100644 --- a/tests/functional/openlp_core/common/test_settings.py +++ b/tests/functional/openlp_core/common/test_settings.py @@ -28,7 +28,6 @@ from unittest.mock import call, patch from openlp.core.common import settings from openlp.core.common.settings import Settings, media_players_conv - from tests.helpers.testmixin import TestMixin diff --git a/tests/functional/openlp_core/display/test_renderer.py b/tests/functional/openlp_core/display/test_renderer.py index b1478c7b9..a66ebd2cc 100644 --- a/tests/functional/openlp_core/display/test_renderer.py +++ b/tests/functional/openlp_core/display/test_renderer.py @@ -28,12 +28,11 @@ from unittest.mock import MagicMock, patch from PyQt5 import QtCore from openlp.core.common.registry import Registry -from openlp.core.display.screens import ScreenList from openlp.core.display.renderer import Renderer, words_split, get_start_tags +from openlp.core.display.screens import ScreenList from openlp.core.lib import ServiceItem from openlp.core.lib.theme import Theme - SCREEN = { 'primary': False, 'number': 1, diff --git a/tests/functional/openlp_core/lib/test_db.py b/tests/functional/openlp_core/lib/test_db.py index 033508965..cc928ac56 100644 --- a/tests/functional/openlp_core/lib/test_db.py +++ b/tests/functional/openlp_core/lib/test_db.py @@ -23,14 +23,13 @@ Package to test the openlp.core.lib package. """ import shutil - from tempfile import mkdtemp from unittest import TestCase from unittest.mock import patch, MagicMock -from sqlalchemy.pool import NullPool -from sqlalchemy.orm.scoping import ScopedSession from sqlalchemy import MetaData +from sqlalchemy.orm.scoping import ScopedSession +from sqlalchemy.pool import NullPool from openlp.core.common.path import Path from openlp.core.lib.db import init_db, get_upgrade_op, delete_database, upgrade_db diff --git a/tests/functional/openlp_core/lib/test_htmlbuilder.py b/tests/functional/openlp_core/lib/test_htmlbuilder.py index ffd796ecb..11bfde2b6 100644 --- a/tests/functional/openlp_core/lib/test_htmlbuilder.py +++ b/tests/functional/openlp_core/lib/test_htmlbuilder.py @@ -10,7 +10,6 @@ from openlp.core.common.settings import Settings from openlp.core.lib.htmlbuilder import build_html, build_background_css, build_lyrics_css, build_lyrics_outline_css, \ build_lyrics_format_css, build_footer_css, webkit_version, build_chords_css from openlp.core.lib.theme import HorizontalType, VerticalType - from tests.helpers.testmixin import TestMixin HTML = """ diff --git a/tests/functional/openlp_core/lib/test_image_manager.py b/tests/functional/openlp_core/lib/test_image_manager.py index 0aaa9ba0c..00955597d 100644 --- a/tests/functional/openlp_core/lib/test_image_manager.py +++ b/tests/functional/openlp_core/lib/test_image_manager.py @@ -33,7 +33,6 @@ from PyQt5 import QtGui from openlp.core.common.registry import Registry from openlp.core.display.screens import ScreenList from openlp.core.lib.imagemanager import ImageManager, Priority - from tests.helpers.testmixin import TestMixin from tests.utils.constants import RESOURCE_PATH diff --git a/tests/functional/openlp_core/lib/test_mediamanageritem.py b/tests/functional/openlp_core/lib/test_mediamanageritem.py index 6c659a5bc..aba4d4c06 100644 --- a/tests/functional/openlp_core/lib/test_mediamanageritem.py +++ b/tests/functional/openlp_core/lib/test_mediamanageritem.py @@ -26,7 +26,6 @@ from unittest import TestCase from unittest.mock import MagicMock, patch from openlp.core.lib import MediaManagerItem - from tests.helpers.testmixin import TestMixin diff --git a/tests/functional/openlp_core/lib/test_pluginmanager.py b/tests/functional/openlp_core/lib/test_pluginmanager.py index 163f52877..553221ff2 100644 --- a/tests/functional/openlp_core/lib/test_pluginmanager.py +++ b/tests/functional/openlp_core/lib/test_pluginmanager.py @@ -27,8 +27,8 @@ from unittest.mock import MagicMock from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings -from openlp.core.lib.pluginmanager import PluginManager from openlp.core.lib import PluginStatus +from openlp.core.lib.pluginmanager import PluginManager class TestPluginManager(TestCase): diff --git a/tests/functional/openlp_core/lib/test_serviceitem.py b/tests/functional/openlp_core/lib/test_serviceitem.py index 7e094751c..63544458a 100644 --- a/tests/functional/openlp_core/lib/test_serviceitem.py +++ b/tests/functional/openlp_core/lib/test_serviceitem.py @@ -30,7 +30,6 @@ from openlp.core.common import md5_hash from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings from openlp.core.lib import ItemCapabilities, ServiceItem, ServiceItemType, FormattingTags - from tests.helpers.testmixin import TestMixin from tests.utils import assert_length, convert_file_service_item from tests.utils.constants import RESOURCE_PATH diff --git a/tests/functional/openlp_core/lib/test_theme.py b/tests/functional/openlp_core/lib/test_theme.py index 4e6407d1c..bdafa3ea8 100644 --- a/tests/functional/openlp_core/lib/test_theme.py +++ b/tests/functional/openlp_core/lib/test_theme.py @@ -22,7 +22,6 @@ """ Package to test the openlp.core.lib.theme package. """ -import os from pathlib import Path from unittest import TestCase diff --git a/tests/functional/openlp_core/projectors/test_projector_bugfixes_01.py b/tests/functional/openlp_core/projectors/test_projector_bugfixes_01.py index da0aae47f..8cceb6ef6 100644 --- a/tests/functional/openlp_core/projectors/test_projector_bugfixes_01.py +++ b/tests/functional/openlp_core/projectors/test_projector_bugfixes_01.py @@ -26,7 +26,6 @@ from unittest import TestCase from openlp.core.projectors.db import Projector from openlp.core.projectors.pjlink import PJLink - from tests.resources.projector.data import TEST1_DATA diff --git a/tests/functional/openlp_core/projectors/test_projector_db.py b/tests/functional/openlp_core/projectors/test_projector_db.py index 1dfe47a54..619f16bf2 100644 --- a/tests/functional/openlp_core/projectors/test_projector_db.py +++ b/tests/functional/openlp_core/projectors/test_projector_db.py @@ -28,7 +28,6 @@ PREREQUISITE: add_record() and get_all() functions validated. import os import shutil from tempfile import mkdtemp - from unittest import TestCase from unittest.mock import patch @@ -36,7 +35,6 @@ from openlp.core.lib.db import upgrade_db from openlp.core.projectors import upgrade from openlp.core.projectors.constants import PJLINK_PORT from openlp.core.projectors.db import Manufacturer, Model, Projector, ProjectorDB, ProjectorSource, Source - from tests.resources.projector.data import TEST_DB_PJLINK1, TEST_DB, TEST1_DATA, TEST2_DATA, TEST3_DATA from tests.utils.constants import TEST_RESOURCES_PATH diff --git a/tests/functional/openlp_core/projectors/test_projector_pjlink_base.py b/tests/functional/openlp_core/projectors/test_projector_pjlink_base.py index c86904bad..cc6f6e0cb 100644 --- a/tests/functional/openlp_core/projectors/test_projector_pjlink_base.py +++ b/tests/functional/openlp_core/projectors/test_projector_pjlink_base.py @@ -28,7 +28,6 @@ from unittest.mock import call, patch, MagicMock from openlp.core.projectors.constants import E_PARAMETER, ERROR_STRING, S_ON, S_CONNECTED, S_QSOCKET_STATE from openlp.core.projectors.db import Projector from openlp.core.projectors.pjlink import PJLink - from tests.resources.projector.data import TEST1_DATA pjlink_test = PJLink(Projector(**TEST1_DATA), no_poll=True) diff --git a/tests/functional/openlp_core/projectors/test_projector_pjlink_commands_01.py b/tests/functional/openlp_core/projectors/test_projector_pjlink_commands_01.py index 8340a0fd0..73a66a0f0 100644 --- a/tests/functional/openlp_core/projectors/test_projector_pjlink_commands_01.py +++ b/tests/functional/openlp_core/projectors/test_projector_pjlink_commands_01.py @@ -32,7 +32,6 @@ from openlp.core.projectors.constants import ERROR_STRING, PJLINK_ERST_DATA, PJL S_CONNECTED, S_OFF, S_ON, S_NOT_CONNECTED, S_CONNECTING, S_STANDBY from openlp.core.projectors.db import Projector from openlp.core.projectors.pjlink import PJLink - from tests.resources.projector.data import TEST_PIN, TEST1_DATA pjlink_test = PJLink(Projector(**TEST1_DATA), pin=TEST_PIN, no_poll=True) diff --git a/tests/functional/openlp_core/projectors/test_projector_pjlink_commands_02.py b/tests/functional/openlp_core/projectors/test_projector_pjlink_commands_02.py index 62ba4ec76..c9ccc2543 100644 --- a/tests/functional/openlp_core/projectors/test_projector_pjlink_commands_02.py +++ b/tests/functional/openlp_core/projectors/test_projector_pjlink_commands_02.py @@ -29,7 +29,6 @@ import openlp.core.projectors.pjlink from openlp.core.projectors.constants import S_CONNECTED from openlp.core.projectors.db import Projector from openlp.core.projectors.pjlink import PJLink - from tests.resources.projector.data import TEST_HASH, TEST_PIN, TEST_SALT, TEST1_DATA diff --git a/tests/functional/openlp_core/test_app.py b/tests/functional/openlp_core/test_app.py index 5ed23224d..755197e5c 100644 --- a/tests/functional/openlp_core/test_app.py +++ b/tests/functional/openlp_core/test_app.py @@ -19,7 +19,6 @@ # with this program; if not, write to the Free Software Foundation, Inc., 59 # # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -import os import sys from unittest import TestCase, skip from unittest.mock import MagicMock, patch @@ -28,7 +27,6 @@ from PyQt5 import QtCore, QtWidgets from openlp.core.app import OpenLP, parse_options from openlp.core.common.settings import Settings - from tests.utils.constants import RESOURCE_PATH diff --git a/tests/functional/openlp_core/ui/test_aboutform.py b/tests/functional/openlp_core/ui/test_aboutform.py index e90764e88..049fb68c4 100644 --- a/tests/functional/openlp_core/ui/test_aboutform.py +++ b/tests/functional/openlp_core/ui/test_aboutform.py @@ -27,7 +27,6 @@ from unittest import TestCase from unittest.mock import patch from openlp.core.ui.aboutform import AboutForm - from tests.helpers.testmixin import TestMixin diff --git a/tests/functional/openlp_core/ui/test_advancedtab.py b/tests/functional/openlp_core/ui/test_advancedtab.py index 52cf2068f..514c68ea9 100644 --- a/tests/functional/openlp_core/ui/test_advancedtab.py +++ b/tests/functional/openlp_core/ui/test_advancedtab.py @@ -27,7 +27,6 @@ from unittest import TestCase from openlp.core.common.registry import Registry from openlp.core.ui.advancedtab import AdvancedTab from openlp.core.ui.settingsform import SettingsForm - from tests.helpers.testmixin import TestMixin diff --git a/tests/functional/openlp_core/ui/test_exceptionform.py b/tests/functional/openlp_core/ui/test_exceptionform.py index 3bc99d63f..207805f37 100644 --- a/tests/functional/openlp_core/ui/test_exceptionform.py +++ b/tests/functional/openlp_core/ui/test_exceptionform.py @@ -24,14 +24,12 @@ Package to test the openlp.core.ui.exeptionform package. """ import os import tempfile - from unittest import TestCase from unittest.mock import call, patch -from openlp.core.common.registry import Registry from openlp.core.common.path import Path +from openlp.core.common.registry import Registry from openlp.core.ui import exceptionform - from tests.helpers.testmixin import TestMixin exceptionform.WEBKIT_VERSION = 'Webkit Test' diff --git a/tests/functional/openlp_core/ui/test_first_time.py b/tests/functional/openlp_core/ui/test_first_time.py index 2be5e1ad6..b6404d2b1 100644 --- a/tests/functional/openlp_core/ui/test_first_time.py +++ b/tests/functional/openlp_core/ui/test_first_time.py @@ -26,7 +26,6 @@ from unittest import TestCase from unittest.mock import patch from openlp.core.common.httputils import CONNECTION_RETRIES, get_web_page - from tests.helpers.testmixin import TestMixin diff --git a/tests/functional/openlp_core/ui/test_firsttimeform.py b/tests/functional/openlp_core/ui/test_firsttimeform.py index 2629eaa37..1c9d7dd55 100644 --- a/tests/functional/openlp_core/ui/test_firsttimeform.py +++ b/tests/functional/openlp_core/ui/test_firsttimeform.py @@ -24,14 +24,12 @@ Package to test the openlp.core.ui.firsttimeform package. """ import os import tempfile -import urllib from unittest import TestCase from unittest.mock import MagicMock, patch -from openlp.core.common.registry import Registry from openlp.core.common.path import Path +from openlp.core.common.registry import Registry from openlp.core.ui.firsttimeform import FirstTimeForm - from tests.helpers.testmixin import TestMixin FAKE_CONFIG = """ diff --git a/tests/functional/openlp_core/ui/test_maindisplay.py b/tests/functional/openlp_core/ui/test_maindisplay.py index 04ffa1d8c..cbfefa6a2 100644 --- a/tests/functional/openlp_core/ui/test_maindisplay.py +++ b/tests/functional/openlp_core/ui/test_maindisplay.py @@ -34,7 +34,6 @@ from openlp.core.display.screens import ScreenList from openlp.core.lib import PluginManager from openlp.core.ui import MainDisplay, AudioPlayer from openlp.core.ui.maindisplay import TRANSPARENT_STYLESHEET, OPAQUE_STYLESHEET - from tests.helpers.testmixin import TestMixin if is_macosx(): diff --git a/tests/functional/openlp_core/ui/test_mainwindow.py b/tests/functional/openlp_core/ui/test_mainwindow.py index 9d655277c..d81d3d790 100644 --- a/tests/functional/openlp_core/ui/test_mainwindow.py +++ b/tests/functional/openlp_core/ui/test_mainwindow.py @@ -32,7 +32,6 @@ from openlp.core.common.i18n import UiStrings from openlp.core.common.registry import Registry from openlp.core.display.screens import ScreenList from openlp.core.ui.mainwindow import MainWindow - from tests.helpers.testmixin import TestMixin from tests.utils.constants import TEST_RESOURCES_PATH diff --git a/tests/functional/openlp_core/ui/test_media.py b/tests/functional/openlp_core/ui/test_media.py index d11745ae9..eef1907e3 100644 --- a/tests/functional/openlp_core/ui/test_media.py +++ b/tests/functional/openlp_core/ui/test_media.py @@ -28,7 +28,6 @@ from unittest.mock import patch from PyQt5 import QtCore from openlp.core.ui.media import get_media_players, parse_optical_path - from tests.helpers.testmixin import TestMixin diff --git a/tests/functional/openlp_core/ui/test_thememanager.py b/tests/functional/openlp_core/ui/test_thememanager.py index 79d467583..d1b458768 100644 --- a/tests/functional/openlp_core/ui/test_thememanager.py +++ b/tests/functional/openlp_core/ui/test_thememanager.py @@ -30,10 +30,9 @@ from unittest.mock import ANY, MagicMock, patch from PyQt5 import QtWidgets -from openlp.core.common.registry import Registry from openlp.core.common.path import Path +from openlp.core.common.registry import Registry from openlp.core.ui import ThemeManager - from tests.utils.constants import TEST_RESOURCES_PATH diff --git a/tests/functional/openlp_core/ui/test_themetab.py b/tests/functional/openlp_core/ui/test_themetab.py index b88d3a246..f27f4a2ca 100644 --- a/tests/functional/openlp_core/ui/test_themetab.py +++ b/tests/functional/openlp_core/ui/test_themetab.py @@ -26,9 +26,8 @@ from unittest import TestCase from unittest.mock import MagicMock from openlp.core.common.registry import Registry -from openlp.core.ui.themestab import ThemesTab from openlp.core.ui.settingsform import SettingsForm - +from openlp.core.ui.themestab import ThemesTab from tests.helpers.testmixin import TestMixin diff --git a/tests/functional/openlp_core/widgets/test_edits.py b/tests/functional/openlp_core/widgets/test_edits.py index 0d997c906..309cc965e 100755 --- a/tests/functional/openlp_core/widgets/test_edits.py +++ b/tests/functional/openlp_core/widgets/test_edits.py @@ -27,9 +27,9 @@ from unittest import TestCase from unittest.mock import MagicMock, PropertyMock, patch from openlp.core.common.path import Path -from openlp.core.widgets.enums import PathEditType from openlp.core.widgets.dialogs import FileDialog from openlp.core.widgets.edits import PathEdit +from openlp.core.widgets.enums import PathEditType class TestPathEdit(TestCase): diff --git a/tests/functional/openlp_plugins/alerts/test_manager.py b/tests/functional/openlp_plugins/alerts/test_manager.py index ad1b47a64..ea6d8d20a 100644 --- a/tests/functional/openlp_plugins/alerts/test_manager.py +++ b/tests/functional/openlp_plugins/alerts/test_manager.py @@ -22,10 +22,8 @@ """ This module contains tests for the CSV Bible importer. """ -import os -import json from unittest import TestCase -from unittest.mock import MagicMock, patch +from unittest.mock import MagicMock from openlp.core.common.registry import Registry from openlp.plugins.alerts.lib.alertsmanager import AlertsManager diff --git a/tests/functional/openlp_plugins/bibles/test_bibleimport.py b/tests/functional/openlp_plugins/bibles/test_bibleimport.py index 9b9a8fae8..013bbc267 100644 --- a/tests/functional/openlp_plugins/bibles/test_bibleimport.py +++ b/tests/functional/openlp_plugins/bibles/test_bibleimport.py @@ -26,8 +26,8 @@ from io import BytesIO from unittest import TestCase from unittest.mock import MagicMock, patch -from lxml import etree, objectify from PyQt5.QtWidgets import QDialog +from lxml import etree, objectify from openlp.core.common.i18n import Language from openlp.core.common.path import Path diff --git a/tests/functional/openlp_plugins/bibles/test_csvimport.py b/tests/functional/openlp_plugins/bibles/test_csvimport.py index 71de3acda..5c829768c 100644 --- a/tests/functional/openlp_plugins/bibles/test_csvimport.py +++ b/tests/functional/openlp_plugins/bibles/test_csvimport.py @@ -31,7 +31,6 @@ from openlp.core.common.path import Path from openlp.core.lib.exceptions import ValidationError from openlp.plugins.bibles.lib.bibleimport import BibleImport from openlp.plugins.bibles.lib.importers.csvbible import Book, CSVBible, Verse - from tests.utils import load_external_result_data from tests.utils.constants import RESOURCE_PATH diff --git a/tests/functional/openlp_plugins/bibles/test_lib.py b/tests/functional/openlp_plugins/bibles/test_lib.py index c46a74da5..61a965eab 100644 --- a/tests/functional/openlp_plugins/bibles/test_lib.py +++ b/tests/functional/openlp_plugins/bibles/test_lib.py @@ -27,7 +27,6 @@ from unittest.mock import MagicMock, patch from openlp.plugins.bibles import lib from openlp.plugins.bibles.lib import SearchResults, get_reference_match - from tests.helpers.testmixin import TestMixin diff --git a/tests/functional/openlp_plugins/bibles/test_mediaitem.py b/tests/functional/openlp_plugins/bibles/test_mediaitem.py index aad532a87..95f51acf0 100755 --- a/tests/functional/openlp_plugins/bibles/test_mediaitem.py +++ b/tests/functional/openlp_plugins/bibles/test_mediaitem.py @@ -27,12 +27,11 @@ from unittest.mock import MagicMock, call, patch from PyQt5 import QtCore, QtWidgets -from tests.helpers.testmixin import TestMixin - from openlp.core.common.registry import Registry from openlp.core.lib import MediaManagerItem from openlp.plugins.bibles.lib.mediaitem import BibleMediaItem, BibleSearch, ResultsTab, SearchStatus, SearchTabs, \ get_reference_separators, VALID_TEXT_SEARCH +from tests.helpers.testmixin import TestMixin class TestBibleMediaItemModulefunctions(TestCase): diff --git a/tests/functional/openlp_plugins/bibles/test_osisimport.py b/tests/functional/openlp_plugins/bibles/test_osisimport.py index 77a703863..1cb3736f6 100644 --- a/tests/functional/openlp_plugins/bibles/test_osisimport.py +++ b/tests/functional/openlp_plugins/bibles/test_osisimport.py @@ -28,7 +28,6 @@ from unittest.mock import MagicMock, call, patch from openlp.plugins.bibles.lib.bibleimport import BibleImport from openlp.plugins.bibles.lib.db import BibleDB from openlp.plugins.bibles.lib.importers.osis import OSISBible - from tests.utils import load_external_result_data from tests.utils.constants import RESOURCE_PATH diff --git a/tests/functional/openlp_plugins/bibles/test_zefaniaimport.py b/tests/functional/openlp_plugins/bibles/test_zefaniaimport.py index 20733ca1f..4ef4568aa 100644 --- a/tests/functional/openlp_plugins/bibles/test_zefaniaimport.py +++ b/tests/functional/openlp_plugins/bibles/test_zefaniaimport.py @@ -27,7 +27,6 @@ from unittest.mock import MagicMock, patch from openlp.plugins.bibles.lib.db import BibleDB from openlp.plugins.bibles.lib.importers.zefania import ZefaniaBible - from tests.utils import load_external_result_data from tests.utils.constants import RESOURCE_PATH diff --git a/tests/functional/openlp_plugins/media/test_mediaitem.py b/tests/functional/openlp_plugins/media/test_mediaitem.py index 9addb988c..fdcfd0ccd 100644 --- a/tests/functional/openlp_plugins/media/test_mediaitem.py +++ b/tests/functional/openlp_plugins/media/test_mediaitem.py @@ -27,10 +27,9 @@ from unittest.mock import MagicMock, patch from PyQt5 import QtCore -from openlp.core.common.settings import Settings from openlp.core.common.path import Path +from openlp.core.common.settings import Settings from openlp.plugins.media.lib.mediaitem import MediaMediaItem - from tests.helpers.testmixin import TestMixin __default_settings__ = { diff --git a/tests/functional/openlp_plugins/media/test_mediaplugin.py b/tests/functional/openlp_plugins/media/test_mediaplugin.py index e22c31c7e..6cbf91fb7 100644 --- a/tests/functional/openlp_plugins/media/test_mediaplugin.py +++ b/tests/functional/openlp_plugins/media/test_mediaplugin.py @@ -27,7 +27,6 @@ from unittest.mock import patch from openlp.core.common.registry import Registry from openlp.plugins.media.mediaplugin import MediaPlugin, process_check_binary - from tests.helpers.testmixin import TestMixin diff --git a/tests/functional/openlp_plugins/songs/test_db.py b/tests/functional/openlp_plugins/songs/test_db.py index e8b22564e..edf27e9a8 100644 --- a/tests/functional/openlp_plugins/songs/test_db.py +++ b/tests/functional/openlp_plugins/songs/test_db.py @@ -24,12 +24,12 @@ This module contains tests for the db submodule of the Songs plugin. """ import os import shutil -from unittest import TestCase from tempfile import mkdtemp +from unittest import TestCase -from openlp.plugins.songs.lib.db import Song, Author, AuthorType, Book -from openlp.plugins.songs.lib import upgrade from openlp.core.lib.db import upgrade_db +from openlp.plugins.songs.lib import upgrade +from openlp.plugins.songs.lib.db import Song, Author, AuthorType, Book from tests.utils.constants import TEST_RESOURCES_PATH diff --git a/tests/functional/openlp_plugins/songs/test_editsongform.py b/tests/functional/openlp_plugins/songs/test_editsongform.py index 86ef0794a..e8878db23 100644 --- a/tests/functional/openlp_plugins/songs/test_editsongform.py +++ b/tests/functional/openlp_plugins/songs/test_editsongform.py @@ -29,7 +29,6 @@ from PyQt5 import QtCore from openlp.core.common.registry import Registry from openlp.plugins.songs.forms.editsongform import EditSongForm - from tests.helpers.testmixin import TestMixin diff --git a/tests/functional/openlp_plugins/songs/test_editverseform.py b/tests/functional/openlp_plugins/songs/test_editverseform.py index 4ef3ee4c3..45f84857d 100644 --- a/tests/functional/openlp_plugins/songs/test_editverseform.py +++ b/tests/functional/openlp_plugins/songs/test_editverseform.py @@ -29,7 +29,6 @@ from PyQt5 import QtCore from openlp.core.common.settings import Settings from openlp.plugins.songs.forms.editverseform import EditVerseForm - from tests.helpers.testmixin import TestMixin __default_settings__ = { diff --git a/tests/functional/openlp_plugins/songs/test_ewimport.py b/tests/functional/openlp_plugins/songs/test_ewimport.py index 47d343ef5..858593e86 100644 --- a/tests/functional/openlp_plugins/songs/test_ewimport.py +++ b/tests/functional/openlp_plugins/songs/test_ewimport.py @@ -28,7 +28,6 @@ from unittest.mock import MagicMock, patch from openlp.core.common.registry import Registry from openlp.plugins.songs.lib.importers.easyworship import EasyWorshipSongImport, FieldDescEntry, FieldType - from tests.utils.constants import RESOURCE_PATH TEST_PATH = RESOURCE_PATH / 'easyworshipsongs' diff --git a/tests/functional/openlp_plugins/songs/test_mediaitem.py b/tests/functional/openlp_plugins/songs/test_mediaitem.py index 380a689d6..a9347f7f1 100644 --- a/tests/functional/openlp_plugins/songs/test_mediaitem.py +++ b/tests/functional/openlp_plugins/songs/test_mediaitem.py @@ -32,7 +32,6 @@ from openlp.core.common.settings import Settings from openlp.core.lib import ServiceItem from openlp.plugins.songs.lib.db import AuthorType, Song from openlp.plugins.songs.lib.mediaitem import SongMediaItem - from tests.helpers.testmixin import TestMixin diff --git a/tests/functional/openlp_plugins/songs/test_mediashout.py b/tests/functional/openlp_plugins/songs/test_mediashout.py index 4ce5685a4..22809a4f2 100644 --- a/tests/functional/openlp_plugins/songs/test_mediashout.py +++ b/tests/functional/openlp_plugins/songs/test_mediashout.py @@ -27,6 +27,7 @@ from unittest import TestCase, skipUnless from unittest.mock import MagicMock, patch, call from openlp.core.common.registry import Registry + try: from openlp.plugins.songs.lib.importers.mediashout import MediaShoutImport CAN_RUN_TESTS = True diff --git a/tests/functional/openlp_plugins/songs/test_openlyricsexport.py b/tests/functional/openlp_plugins/songs/test_openlyricsexport.py index b04a8df7a..0dc2aaaae 100644 --- a/tests/functional/openlp_plugins/songs/test_openlyricsexport.py +++ b/tests/functional/openlp_plugins/songs/test_openlyricsexport.py @@ -26,10 +26,9 @@ from tempfile import mkdtemp from unittest import TestCase from unittest.mock import MagicMock, patch -from openlp.core.common.registry import Registry from openlp.core.common.path import Path +from openlp.core.common.registry import Registry from openlp.plugins.songs.lib.openlyricsexport import OpenLyricsExport - from tests.helpers.testmixin import TestMixin diff --git a/tests/functional/openlp_plugins/songs/test_openlyricsimport.py b/tests/functional/openlp_plugins/songs/test_openlyricsimport.py index 88bc968ab..8b3b5ade9 100644 --- a/tests/functional/openlp_plugins/songs/test_openlyricsimport.py +++ b/tests/functional/openlp_plugins/songs/test_openlyricsimport.py @@ -33,7 +33,6 @@ from openlp.core.common.settings import Settings from openlp.plugins.songs.lib.importers.openlyrics import OpenLyricsImport from openlp.plugins.songs.lib.importers.songimport import SongImport from openlp.plugins.songs.lib.openlyricsxml import OpenLyrics - from tests.helpers.testmixin import TestMixin from tests.utils.constants import RESOURCE_PATH diff --git a/tests/functional/openlp_plugins/songs/test_openoffice.py b/tests/functional/openlp_plugins/songs/test_openoffice.py index e37a1c5d5..079af801b 100644 --- a/tests/functional/openlp_plugins/songs/test_openoffice.py +++ b/tests/functional/openlp_plugins/songs/test_openoffice.py @@ -26,7 +26,6 @@ from unittest import TestCase, skipIf from unittest.mock import MagicMock, patch from openlp.core.common.registry import Registry - from tests.helpers.testmixin import TestMixin try: diff --git a/tests/functional/openlp_plugins/songs/test_opensongimport.py b/tests/functional/openlp_plugins/songs/test_opensongimport.py index 961cd6563..1a8001fd0 100644 --- a/tests/functional/openlp_plugins/songs/test_opensongimport.py +++ b/tests/functional/openlp_plugins/songs/test_opensongimport.py @@ -27,7 +27,6 @@ from unittest.mock import patch, MagicMock from openlp.core.common.registry import Registry from openlp.plugins.songs.lib.importers.opensong import OpenSongImport - from tests.helpers.songfileimport import SongImportTestHelper from tests.utils.constants import RESOURCE_PATH diff --git a/tests/functional/openlp_plugins/songs/test_songbeamerimport.py b/tests/functional/openlp_plugins/songs/test_songbeamerimport.py index d85e92231..47dd54704 100644 --- a/tests/functional/openlp_plugins/songs/test_songbeamerimport.py +++ b/tests/functional/openlp_plugins/songs/test_songbeamerimport.py @@ -27,7 +27,6 @@ from unittest.mock import MagicMock, patch from openlp.core.common.registry import Registry from openlp.plugins.songs.lib.importers.songbeamer import SongBeamerImport, SongBeamerTypes - from tests.helpers.songfileimport import SongImportTestHelper from tests.utils.constants import RESOURCE_PATH diff --git a/tests/functional/openlp_plugins/songs/test_songselect.py b/tests/functional/openlp_plugins/songs/test_songselect.py index f892b82ab..9ef501089 100644 --- a/tests/functional/openlp_plugins/songs/test_songselect.py +++ b/tests/functional/openlp_plugins/songs/test_songselect.py @@ -33,7 +33,6 @@ from openlp.core.common.registry import Registry from openlp.plugins.songs.forms.songselectform import SongSelectForm, SearchWorker from openlp.plugins.songs.lib import Song from openlp.plugins.songs.lib.songselect import SongSelectImport, LOGOUT_URL, BASE_URL - from tests.helpers.songfileimport import SongImportTestHelper from tests.helpers.testmixin import TestMixin from tests.utils.constants import RESOURCE_PATH diff --git a/tests/functional/openlp_plugins/songs/test_songshowplusimport.py b/tests/functional/openlp_plugins/songs/test_songshowplusimport.py index 5119dabb1..1ab3d43c7 100644 --- a/tests/functional/openlp_plugins/songs/test_songshowplusimport.py +++ b/tests/functional/openlp_plugins/songs/test_songshowplusimport.py @@ -27,7 +27,6 @@ from unittest.mock import patch, MagicMock from openlp.plugins.songs.lib import VerseType from openlp.plugins.songs.lib.importers.songshowplus import SongShowPlusImport - from tests.helpers.songfileimport import SongImportTestHelper from tests.utils.constants import RESOURCE_PATH diff --git a/tests/functional/openlp_plugins/songs/test_zionworximport.py b/tests/functional/openlp_plugins/songs/test_zionworximport.py index 69808481e..01a02d53d 100644 --- a/tests/functional/openlp_plugins/songs/test_zionworximport.py +++ b/tests/functional/openlp_plugins/songs/test_zionworximport.py @@ -28,7 +28,6 @@ from unittest.mock import MagicMock, patch from openlp.core.common.registry import Registry from openlp.plugins.songs.lib.importers.songimport import SongImport from openlp.plugins.songs.lib.importers.zionworx import ZionWorxImport - from tests.helpers.songfileimport import SongImportTestHelper from tests.utils.constants import RESOURCE_PATH diff --git a/tests/helpers/testmixin.py b/tests/helpers/testmixin.py index facd949f9..a76428f3d 100644 --- a/tests/helpers/testmixin.py +++ b/tests/helpers/testmixin.py @@ -26,6 +26,7 @@ import os from tempfile import mkstemp from PyQt5 import QtCore, QtWidgets + from openlp.core.common.settings import Settings diff --git a/tests/resources/projector/data.py b/tests/resources/projector/data.py index d9baa80d0..bd7aa03e3 100644 --- a/tests/resources/projector/data.py +++ b/tests/resources/projector/data.py @@ -23,9 +23,6 @@ The :mod:`tests.resources.projector.data file contains test data """ -import os -from tempfile import gettempdir - # Test data TEST_DB_PJLINK1 = 'projector_pjlink1.sqlite' diff --git a/tests/utils/__init__.py b/tests/utils/__init__.py index 265df0a79..7c34add12 100644 --- a/tests/utils/__init__.py +++ b/tests/utils/__init__.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 +import json ############################################################################### # OpenLP - Open Source Lyrics Projection # # --------------------------------------------------------------------------- # @@ -20,7 +21,6 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### import os -import json def assert_length(expected, iterable, msg=None): diff --git a/tests/utils/osdinteraction.py b/tests/utils/osdinteraction.py index d6beb54bf..8b6862037 100644 --- a/tests/utils/osdinteraction.py +++ b/tests/utils/osdinteraction.py @@ -23,8 +23,8 @@ The :mod:`osdinteraction` provides miscellaneous functions for interacting with OSD files. """ -import os import json +import os from tests.utils.constants import TEST_RESOURCES_PATH diff --git a/tests/utils/test_bzr_tags.py b/tests/utils/test_bzr_tags.py index 3026c689a..3d105f4e0 100644 --- a/tests/utils/test_bzr_tags.py +++ b/tests/utils/test_bzr_tags.py @@ -23,9 +23,8 @@ Package to test for proper bzr tags. """ import os -from unittest import TestCase - from subprocess import Popen, PIPE +from unittest import TestCase TAGS1 = {'1.9.0', '1.9.1', '1.9.2', '1.9.3', '1.9.4', '1.9.5', '1.9.6', '1.9.7', '1.9.8', '1.9.9', '1.9.10', '1.9.11', '1.9.12', '2.0', '2.1.0', '2.1.1', '2.1.2', '2.1.3', '2.1.4', '2.1.5', '2.1.6', '2.2', diff --git a/tests/utils/test_pylint.py b/tests/utils/test_pylint.py index 264005a14..a705700c6 100644 --- a/tests/utils/test_pylint.py +++ b/tests/utils/test_pylint.py @@ -22,7 +22,6 @@ """ Package to test for proper bzr tags. """ -import os import platform import sys from unittest import TestCase, SkipTest