From 1ddd65304a82a25f772f5d4d4af01f13f21d21fa Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 19 Aug 2015 19:37:19 +0200 Subject: [PATCH] tests: Use a real signal for ConfigStub. --- tests/conftest.py | 2 +- tests/helpers/stubs.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 251ec60ef..f91c90295 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -147,7 +147,7 @@ def cmdline_test(request): @pytest.yield_fixture def config_stub(stubs): """Fixture which provides a fake config object.""" - stub = stubs.ConfigStub(signal=stubs.FakeSignal()) + stub = stubs.ConfigStub() objreg.register('config', stub) yield stub objreg.delete('config') diff --git a/tests/helpers/stubs.py b/tests/helpers/stubs.py index cf0ee05a9..a826c2ea7 100644 --- a/tests/helpers/stubs.py +++ b/tests/helpers/stubs.py @@ -274,7 +274,7 @@ class FakeTimer(QObject): return self._started -class ConfigStub: +class ConfigStub(QObject): """Stub for the config module. @@ -282,14 +282,16 @@ class ConfigStub: data: The config data to return. """ - def __init__(self, signal): + changed = pyqtSignal(str, str) + + def __init__(self, parent=None): """Constructor. Args: signal: The signal to use for self.changed. """ + super().__init__(parent) self.data = {} - self.changed = signal def section(self, name): """Get a section from the config.