Commit Graph

15 Commits

Author SHA1 Message Date
Florian Bruhin
6f028e9ad0 Update copyright years 2018-02-05 12:19:50 +01:00
Florian Bruhin
3a5241b642 Start using attrs
Closes #1073
2017-09-19 22:21:45 +02:00
Florian Bruhin
822623f2ed Finally update copyrights... 2017-05-09 21:37:03 +02:00
Florian Bruhin
6004bfa72f Don't lose warnings shown in early init phases 2017-02-23 06:48:58 +01:00
Florian Bruhin
e32bbfa8f7 Init message.global_bridge at import time 2016-09-15 14:51:22 +02:00
Florian Bruhin
43a5c46d82 Don't use @pyqtSlot for MessageMock 2016-09-15 14:51:22 +02:00
Florian Bruhin
a2254b671c Adjust tests/messagemock 2016-09-15 14:51:21 +02:00
Florian Bruhin
bf06f4a4d7 tests: Use dedicated logger for message mock
The message mock might handle a message during pytest-qt's processEvents
during test setup. If that happens, depending on the fixture order,
pytest-caplog might not be set up first, which is why the
self._caplog.at_level call can fail:

  File "c:\projects\qutebrowser\qutebrowser\misc\guiprocess.py", line 105, in on_finished
    immediately=True)
  File "C:\projects\qutebrowser\tests\helpers\messagemock.py", line 71, in _handle_error
    self._handle(Level.error, *args, **kwargs)
  File "C:\projects\qutebrowser\tests\helpers\messagemock.py", line 65, in _handle
    with self._caplog.at_level(log_level):  # needed so we don't fail
  File "C:\projects\qutebrowser\.tox\py34\lib\site-packages\pytest_catchlog.py", line 232, in at_level
    obj = logger and logging.getLogger(logger) or self.handler
  File "C:\projects\qutebrowser\.tox\py34\lib\site-packages\pytest_catchlog.py", line 186, in handler
    return self._item.catch_log_handler
  AttributeError: 'Function' object has no attribute 'catch_log_handler'

Full stack:

    c:\projects\qutebrowser-git\.tox\py34\lib\site-packages\pytestqt\plugin.py(100)pytest_runtest_setup()
  -> _process_events()
    c:\projects\qutebrowser-git\.tox\py34\lib\site-packages\pytestqt\plugin.py(140)_process_events()
  -> app.processEvents()
    c:\projects\qutebrowser-git\qutebrowser\misc\guiprocess.py(94)on_error()
  -> self._what, msg), immediately=True)
    c:\projects\qutebrowser-git\tests\helpers\messagemock.py(71)_handle_error()
  -> self._handle(Level.error, *args, **kwargs)
    c:\projects\qutebrowser-git\tests\helpers\messagemock.py(65)_handle()
  -> with self._caplog.at_level(log_level):  # needed so we don't fail
    c:\projects\qutebrowser-git\.tox\py34\lib\site-packages\pytest_catchlog.py(235)at_level()
  -> obj = logger and logging.getLogger(logger) or self.handler
  > c:\projects\qutebrowser-git\.tox\py34\lib\site-packages\pytest_catchlog.py(189)handler()->None

This should fix broken AppVeyor builds.

Fixes #1662.
2016-07-20 14:23:09 +02:00
Florian Bruhin
2649418c0b Fix lint 2016-07-10 17:04:26 +02:00
Florian Bruhin
52e14950f1 tests: Fix messagemock with stack argument 2016-07-10 17:04:25 +02:00
Florian Bruhin
a5f2ac5f03 Adjust copyright years. 2016-01-04 07:12:39 +01:00
Florian Bruhin
416cfaf002 tests: Switch from pytest-capturelog to catchlog. 2015-11-11 19:57:03 +01:00
Florian Bruhin
086c6c81a1 Simplify message_mock usage and assert more things. 2015-08-19 09:44:31 +02:00
Florian Bruhin
e4a0f1972f tests: Improve MessageMock and use it. 2015-08-18 21:38:18 +02:00
Florian Bruhin
6d1b0ba260 Clean up conftest.py. 2015-08-18 20:43:42 +02:00