Import qutebrowser.app in conftest

This commit is contained in:
Florian Bruhin 2017-07-03 22:56:53 +02:00
parent b42265212b
commit 9dfe4429d7
5 changed files with 2 additions and 5 deletions

View File

@ -37,6 +37,8 @@ from helpers.messagemock import message_mock
from helpers.fixtures import * from helpers.fixtures import *
from qutebrowser.utils import qtutils from qutebrowser.utils import qtutils
import qutebrowser.app # To register commands
# Set hypothesis settings # Set hypothesis settings
hypothesis.settings.register_profile('default', hypothesis.settings.register_profile('default',

View File

@ -197,8 +197,6 @@ def _generate_cmdline_tests():
@pytest.fixture(params=_generate_cmdline_tests(), ids=lambda e: e.cmd) @pytest.fixture(params=_generate_cmdline_tests(), ids=lambda e: e.cmd)
def cmdline_test(request): def cmdline_test(request):
"""Fixture which generates tests for things validating commandlines.""" """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 return request.param

View File

@ -25,7 +25,6 @@ import pytest
from PyQt5.QtCore import QObject, QUrl from PyQt5.QtCore import QObject, QUrl
from PyQt5.QtGui import QColor from PyQt5.QtGui import QColor
import qutebrowser.app # To register commands
from qutebrowser.commands import cmdexc from qutebrowser.commands import cmdexc
from qutebrowser.config import config, configdata, configexc, configfiles from qutebrowser.config import config, configdata, configexc, configfiles
from qutebrowser.utils import objreg, usertypes from qutebrowser.utils import objreg, usertypes

View File

@ -1057,7 +1057,6 @@ class TestCommand:
def test_cmdline(self, klass, cmdline_test): def test_cmdline(self, klass, cmdline_test):
"""Test some commandlines from the cmdline_test fixture.""" """Test some commandlines from the cmdline_test fixture."""
import qutebrowser.app # to run decorators
typ = klass() typ = klass()
if cmdline_test.valid: if cmdline_test.valid:
typ.to_py(cmdline_test.cmd) typ.to_py(cmdline_test.cmd)

View File

@ -23,7 +23,6 @@ from unittest import mock
import pytest import pytest
import qutebrowser.app # to run decorators
from qutebrowser.utils import objreg from qutebrowser.utils import objreg