summaryrefslogtreecommitdiff
path: root/tests/unit/utils/test_debug.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/utils/test_debug.py')
-rw-r--r--tests/unit/utils/test_debug.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/unit/utils/test_debug.py b/tests/unit/utils/test_debug.py
index 68484e3c5..2424c2a0b 100644
--- a/tests/unit/utils/test_debug.py
+++ b/tests/unit/utils/test_debug.py
@@ -29,6 +29,7 @@ from PyQt5.QtCore import pyqtSignal, Qt, QEvent, QObject, QTimer
from PyQt5.QtWidgets import QStyle, QFrame, QSpinBox
from qutebrowser.utils import debug
+from qutebrowser.misc import objects
@debug.log_events
@@ -271,7 +272,7 @@ class TestGetAllObjects:
# pylint: disable=unused-variable
widgets = [self.Object('Widget 1'), self.Object('Widget 2')]
app = stubs.FakeQApplication(all_widgets=widgets)
- monkeypatch.setattr(debug, 'QApplication', app)
+ monkeypatch.setattr(objects, 'qapp', app)
root = QObject()
o1 = self.Object('Object 1', root)
@@ -293,9 +294,9 @@ class TestGetAllObjects:
assert debug.get_all_objects(start_obj=root) == expected
- @pytest.mark.usefixtures('qapp')
- def test_get_all_objects_qapp(self):
- objects = debug.get_all_objects()
+ def test_get_all_objects_qapp(self, qapp, monkeypatch):
+ monkeypatch.setattr(objects, 'qapp', qapp)
+ objs = debug.get_all_objects()
event_dispatcher = '<PyQt5.QtCore.QAbstractEventDispatcher object at'
session_manager = '<PyQt5.QtGui.QSessionManager object at'
- assert event_dispatcher in objects or session_manager in objects
+ assert event_dispatcher in objs or session_manager in objs