diff options
author | Florian Bruhin <git@the-compiler.org> | 2015-11-03 06:38:48 +0100 |
---|---|---|
committer | Florian Bruhin <git@the-compiler.org> | 2015-11-03 06:38:48 +0100 |
commit | f5eb755ef38794564c65113d43159869e97dc851 (patch) | |
tree | 1417f6ec472855b72e348d3058c452dd6d0d616f /tests | |
parent | 7e0e770d533310f815c4605cb79cd43063af1fb8 (diff) | |
download | qutebrowser-f5eb755ef38794564c65113d43159869e97dc851.tar.gz qutebrowser-f5eb755ef38794564c65113d43159869e97dc851.zip |
tests: Ignore some Qt warnings during teardown.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration/quteprocess.py | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/tests/integration/quteprocess.py b/tests/integration/quteprocess.py index 8a5423da0..736466802 100644 --- a/tests/integration/quteprocess.py +++ b/tests/integration/quteprocess.py @@ -37,6 +37,15 @@ from qutebrowser.misc import ipc from qutebrowser.utils import log +def is_ignored_qt_message(message): + """Check if the message is listed in qt_log_ignore.""" + regexes = pytest.config.getini('qt_log_ignore') + for regex in regexes: + if re.match(regex, message): + return True + return False + + class NoLineMatch(Exception): """Raised by LogLine on unmatched lines.""" @@ -90,19 +99,11 @@ class LogLine: self.line = int(match.group('line')) self.message = match.group('message') - self.expected = self._is_ignored() + self.expected = is_ignored_qt_message(self.message) def __repr__(self): return 'LogLine({!r})'.format(self._line) - def _is_ignored(self): - """Check if the message is listed in qt_log_ignore.""" - regexes = pytest.config.getini('qt_log_ignore') - for regex in regexes: - if re.match(regex, self.message): - return True - return False - class QuteProc(testprocess.Process): @@ -129,9 +130,7 @@ class QuteProc(testprocess.Process): return None elif not line.strip(): return None - elif (line == "QWaitCondition: Destroyed while threads are still " - "waiting"): - # Happens on Windows during exit sometimes + elif is_ignored_qt_message(line): return None else: raise testprocess.InvalidLine |