From 9dfe4429d7e7537ec475b223be41cacdefe83032 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 3 Jul 2017 22:56:53 +0200 Subject: [PATCH] Import qutebrowser.app in conftest --- tests/conftest.py | 2 ++ tests/helpers/fixtures.py | 2 -- tests/unit/config/test_config.py | 1 - tests/unit/config/test_configtypes.py | 1 - tests/unit/keyinput/conftest.py | 1 - 5 files changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 6ac9515ce..b8597c03f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -37,6 +37,8 @@ from helpers.messagemock import message_mock from helpers.fixtures import * from qutebrowser.utils import qtutils +import qutebrowser.app # To register commands + # Set hypothesis settings hypothesis.settings.register_profile('default', diff --git a/tests/helpers/fixtures.py b/tests/helpers/fixtures.py index df40ecfc2..6a0e4408d 100644 --- a/tests/helpers/fixtures.py +++ b/tests/helpers/fixtures.py @@ -197,8 +197,6 @@ def _generate_cmdline_tests(): @pytest.fixture(params=_generate_cmdline_tests(), ids=lambda e: e.cmd) def cmdline_test(request): """Fixture which generates tests for things validating commandlines.""" - # Import qutebrowser.app so all cmdutils.register decorators get run. - import qutebrowser.app # pylint: disable=unused-variable return request.param diff --git a/tests/unit/config/test_config.py b/tests/unit/config/test_config.py index 79a7f7870..c97d665bc 100644 --- a/tests/unit/config/test_config.py +++ b/tests/unit/config/test_config.py @@ -25,7 +25,6 @@ import pytest from PyQt5.QtCore import QObject, QUrl from PyQt5.QtGui import QColor -import qutebrowser.app # To register commands from qutebrowser.commands import cmdexc from qutebrowser.config import config, configdata, configexc, configfiles from qutebrowser.utils import objreg, usertypes diff --git a/tests/unit/config/test_configtypes.py b/tests/unit/config/test_configtypes.py index 99acd3097..e2c4955a7 100644 --- a/tests/unit/config/test_configtypes.py +++ b/tests/unit/config/test_configtypes.py @@ -1057,7 +1057,6 @@ class TestCommand: def test_cmdline(self, klass, cmdline_test): """Test some commandlines from the cmdline_test fixture.""" - import qutebrowser.app # to run decorators typ = klass() if cmdline_test.valid: typ.to_py(cmdline_test.cmd) diff --git a/tests/unit/keyinput/conftest.py b/tests/unit/keyinput/conftest.py index 18bac33bb..8ed74a41f 100644 --- a/tests/unit/keyinput/conftest.py +++ b/tests/unit/keyinput/conftest.py @@ -23,7 +23,6 @@ from unittest import mock import pytest -import qutebrowser.app # to run decorators from qutebrowser.utils import objreg