This commit is contained in:
Florian Bruhin 2016-09-06 16:46:47 +02:00
parent ce1b2e6f15
commit 7f013b7808
6 changed files with 20 additions and 24 deletions

View File

@ -31,7 +31,6 @@ try:
except ImportError: # pragma: no cover except ImportError: # pragma: no cover
from yaml import SafeLoader as YamlLoader, SafeDumper as YamlDumper from yaml import SafeLoader as YamlLoader, SafeDumper as YamlDumper
from qutebrowser.browser.webkit import tabhistory
from qutebrowser.utils import (standarddir, objreg, qtutils, log, usertypes, from qutebrowser.utils import (standarddir, objreg, qtutils, log, usertypes,
message, utils) message, utils)
from qutebrowser.commands import cmdexc, cmdutils from qutebrowser.commands import cmdexc, cmdutils

View File

@ -17,7 +17,6 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>. # along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
import pytest
import pytest_bdd as bdd import pytest_bdd as bdd
bdd.scenarios('marks.feature') bdd.scenarios('marks.feature')

View File

@ -20,7 +20,6 @@
import os.path import os.path
import logging import logging
import pytest
import pytest_bdd as bdd import pytest_bdd as bdd
bdd.scenarios('sessions.feature') bdd.scenarios('sessions.feature')

View File

@ -183,23 +183,8 @@ class QuteProc(testprocess.Process):
if self._load_ready and self._focus_ready: if self._load_ready and self._focus_ready:
self.ready.emit() self.ready.emit()
def _parse_line(self, line): def _process_line(self, log_line):
try: """Check if the line matches any initial lines we're interested in."""
log_line = LogLine(line)
except testprocess.InvalidLine:
if not line.strip():
return None
elif 'Running without the SUID sandbox!' in line:
# QtWebEngine error
return None
elif is_ignored_qt_message(line):
return None
else:
raise
log_line.use_color = self.request.config.getoption('--color') != 'no'
self._log(log_line)
start_okay_message_load = ( start_okay_message_load = (
"load status for <qutebrowser.browser.* tab_id=0 " "load status for <qutebrowser.browser.* tab_id=0 "
"url='about:blank'>: LoadStatus.success") "url='about:blank'>: LoadStatus.success")
@ -236,6 +221,23 @@ class QuteProc(testprocess.Process):
elif self._is_error_logline(log_line): elif self._is_error_logline(log_line):
self.got_error.emit() self.got_error.emit()
def _parse_line(self, line):
try:
log_line = LogLine(line)
except testprocess.InvalidLine:
if not line.strip():
return None
elif 'Running without the SUID sandbox!' in line:
# QtWebEngine error
return None
elif is_ignored_qt_message(line):
return None
else:
raise
log_line.use_color = self.request.config.getoption('--color') != 'no'
self._log(log_line)
self._process_line(log_line)
return log_line return log_line
def _executable_args(self): def _executable_args(self):

View File

@ -349,7 +349,7 @@ class Process(QObject):
# this line again. # this line again.
line.waited_for = True line.waited_for = True
self._log("\n----> Already found {!r} in the log: {}".format( self._log("\n----> Already found {!r} in the log: {}".format(
kwargs.get('message', 'line'), line)) kwargs.get('message', 'line'), line))
return line return line
return None return None

View File

@ -19,8 +19,6 @@
"""Tests for qutebrowser.misc.sessions.""" """Tests for qutebrowser.misc.sessions."""
import os
import textwrap
import logging import logging
import pytest import pytest
@ -32,7 +30,6 @@ from qutebrowser.misc import sessions
from qutebrowser.misc.sessions import TabHistoryItem as Item from qutebrowser.misc.sessions import TabHistoryItem as Item
from qutebrowser.utils import objreg, qtutils from qutebrowser.utils import objreg, qtutils
from qutebrowser.browser.webkit import tabhistory from qutebrowser.browser.webkit import tabhistory
from qutebrowser.commands import cmdexc
pytestmark = pytest.mark.qt_log_ignore('QIODevice::read.*: device not open') pytestmark = pytest.mark.qt_log_ignore('QIODevice::read.*: device not open')