From c7fdcc92b8d30b2317979a402518c82d4f25413b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 1 Dec 2015 20:59:06 +0100 Subject: [PATCH] Use fully qualified imports in tests. This is cleaner even if pylint can't handle it. --- tests/conftest.py | 8 ++++---- tests/helpers/test_helper_utils.py | 2 +- tests/integration/conftest.py | 4 ++-- tests/integration/features/conftest.py | 2 +- tests/integration/features/test_caret.py | 4 ++-- tests/integration/features/test_urlmarks.py | 2 +- tests/integration/quteprocess.py | 2 +- tests/integration/test_quteprocess.py | 4 ++-- tests/integration/test_testprocess.py | 2 +- tests/integration/testprocess.py | 2 +- tests/integration/webserver.py | 2 +- tests/unit/misc/test_ipc.py | 2 +- tests/unit/utils/test_qtutils.py | 2 +- 13 files changed, 19 insertions(+), 19 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 9fd73fe73..b5b5fde36 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -31,10 +31,10 @@ import warnings import pytest -import helpers.stubs as stubsmod -from helpers import logfail -from helpers.logfail import fail_on_logging -from helpers.messagemock import message_mock +import tests.helpers.stubs as stubsmod +from tests.helpers import logfail +from tests.helpers.logfail import fail_on_logging +from tests.helpers.messagemock import message_mock from qutebrowser.config import config from qutebrowser.utils import objreg diff --git a/tests/helpers/test_helper_utils.py b/tests/helpers/test_helper_utils.py index 6311c08e7..44944049e 100644 --- a/tests/helpers/test_helper_utils.py +++ b/tests/helpers/test_helper_utils.py @@ -20,7 +20,7 @@ import pytest -from helpers import utils # pylint: disable=import-error +from tests.helpers import utils @pytest.mark.parametrize('val1, val2', [ diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 2cf649408..3cd902f9b 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -21,5 +21,5 @@ """Things needed for integration testing.""" -from webserver import httpbin, httpbin_after_test -from quteprocess import quteproc_process, quteproc +from tests.integration.webserver import httpbin, httpbin_after_test +from tests.integration.quteprocess import quteproc_process, quteproc diff --git a/tests/integration/features/conftest.py b/tests/integration/features/conftest.py index 3e9b6f0ba..1f31e3f94 100644 --- a/tests/integration/features/conftest.py +++ b/tests/integration/features/conftest.py @@ -33,7 +33,7 @@ import yaml import pytest_bdd as bdd from PyQt5.QtGui import QClipboard -from helpers import utils # pylint: disable=import-error +from tests.helpers import utils def _clipboard_mode(qapp, what): diff --git a/tests/integration/features/test_caret.py b/tests/integration/features/test_caret.py index 1f59455d1..c296d01fe 100644 --- a/tests/integration/features/test_caret.py +++ b/tests/integration/features/test_caret.py @@ -21,8 +21,8 @@ import pytest import pytest_bdd as bdd -# pylint: disable=unused-import -from test_yankpaste import skip_with_broken_clipboard +# pylint: disable=unused-import,line-too-long +from tests.integration.features.test_yankpaste import skip_with_broken_clipboard # https://github.com/The-Compiler/qutebrowser/issues/1124#issuecomment-158073581 diff --git a/tests/integration/features/test_urlmarks.py b/tests/integration/features/test_urlmarks.py index 14a450e7f..8f7205240 100644 --- a/tests/integration/features/test_urlmarks.py +++ b/tests/integration/features/test_urlmarks.py @@ -21,7 +21,7 @@ import os.path import pytest_bdd as bdd -from helpers import utils # pylint: disable=import-error +from tests.helpers import utils bdd.scenarios('urlmarks.feature') diff --git a/tests/integration/quteprocess.py b/tests/integration/quteprocess.py index e72d1dd9c..b15b138a4 100644 --- a/tests/integration/quteprocess.py +++ b/tests/integration/quteprocess.py @@ -32,7 +32,7 @@ import yaml import pytest from PyQt5.QtCore import pyqtSignal, QUrl -import testprocess # pylint: disable=import-error +from tests.integration import testprocess from qutebrowser.misc import ipc from qutebrowser.utils import log, utils diff --git a/tests/integration/test_quteprocess.py b/tests/integration/test_quteprocess.py index 778c062a3..0d7c0afb2 100644 --- a/tests/integration/test_quteprocess.py +++ b/tests/integration/test_quteprocess.py @@ -24,8 +24,8 @@ import datetime import pytest -import quteprocess -import testprocess +from tests.integration import quteprocess +from tests.integration import testprocess from qutebrowser.utils import log diff --git a/tests/integration/test_testprocess.py b/tests/integration/test_testprocess.py index 9c10923af..9b521efb1 100644 --- a/tests/integration/test_testprocess.py +++ b/tests/integration/test_testprocess.py @@ -27,7 +27,7 @@ import datetime import pytest from PyQt5.QtCore import QProcess -import testprocess +from tests.integration import testprocess pytestmark = [pytest.mark.not_frozen] diff --git a/tests/integration/testprocess.py b/tests/integration/testprocess.py index c641aa9a1..6b7a29bde 100644 --- a/tests/integration/testprocess.py +++ b/tests/integration/testprocess.py @@ -27,7 +27,7 @@ import pytestqt.plugin from PyQt5.QtCore import pyqtSlot, pyqtSignal, QProcess, QObject, QElapsedTimer from PyQt5.QtTest import QSignalSpy -from helpers import utils # pylint: disable=import-error +from tests.helpers import utils class InvalidLine(Exception): diff --git a/tests/integration/webserver.py b/tests/integration/webserver.py index 3848ab902..350f448f8 100644 --- a/tests/integration/webserver.py +++ b/tests/integration/webserver.py @@ -27,7 +27,7 @@ import os.path import pytest from PyQt5.QtCore import pyqtSignal -import testprocess # pylint: disable=import-error +from tests.integration import testprocess class Request(testprocess.Line): diff --git a/tests/unit/misc/test_ipc.py b/tests/unit/misc/test_ipc.py index 62247ca14..3ac693a82 100644 --- a/tests/unit/misc/test_ipc.py +++ b/tests/unit/misc/test_ipc.py @@ -39,7 +39,7 @@ from PyQt5.QtTest import QSignalSpy import qutebrowser from qutebrowser.misc import ipc from qutebrowser.utils import objreg, qtutils -from helpers import stubs # pylint: disable=import-error +from tests.helpers import stubs Args = collections.namedtuple('Args', 'basedir') diff --git a/tests/unit/utils/test_qtutils.py b/tests/unit/utils/test_qtutils.py index fe04b4142..b03712741 100644 --- a/tests/unit/utils/test_qtutils.py +++ b/tests/unit/utils/test_qtutils.py @@ -38,7 +38,7 @@ from PyQt5.QtCore import (QDataStream, QPoint, QUrl, QByteArray, QIODevice, from qutebrowser import qutebrowser from qutebrowser.utils import qtutils -import overflow_test_cases +from tests.unit.utils import overflow_test_cases @pytest.mark.parametrize('qversion, version, op, expected', [