From 0455ca30c7825a6e0ee3198a09fcef6a4493e1fa Mon Sep 17 00:00:00 2001 From: Marvin Pohl Date: Fri, 3 May 2019 22:25:40 +0200 Subject: [PATCH] Use TestReactorMixin which seems to be required now. --- buildbot_gitea/test/test_reporter.py | 6 +++++- buildbot_gitea/test/test_step_source.py | 5 ++++- buildbot_gitea/test/test_webhook.py | 11 ++++++++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/buildbot_gitea/test/test_reporter.py b/buildbot_gitea/test/test_reporter.py index 68bbb8f..8c3d920 100644 --- a/buildbot_gitea/test/test_reporter.py +++ b/buildbot_gitea/test/test_reporter.py @@ -17,17 +17,21 @@ from buildbot.test.fake import fakemaster from buildbot.test.fake import httpclientservice as fakehttpclientservice from buildbot.test.util import logging from buildbot.test.util.reporter import ReporterTestMixin +from buildbot.test.util.misc import TestReactorMixin + class TestGiteaStatusPush( unittest.TestCase, ReporterTestMixin, - logging.LoggingMixin): + logging.LoggingMixin, + TestReactorMixin): # repository must be in the form http://gitea// TEST_REPO = u'http://gitea/buildbot/buildbot' @defer.inlineCallbacks def setUp(self): + self.setUpTestReactor() # ignore config error if txrequests is not installed self.patch(config, '_errors', Mock()) self.master = fakemaster.make_master(testcase=self, diff --git a/buildbot_gitea/test/test_step_source.py b/buildbot_gitea/test/test_step_source.py index ba662fb..61982d0 100644 --- a/buildbot_gitea/test/test_step_source.py +++ b/buildbot_gitea/test/test_step_source.py @@ -24,12 +24,15 @@ from buildbot.test.fake.remotecommand import Expect from buildbot.test.fake.remotecommand import ExpectShell from buildbot.test.util import config from buildbot.test.util import sourcesteps +from buildbot.test.util.misc import TestReactorMixin -class TestGitea(sourcesteps.SourceStepMixin, config.ConfigErrorsMixin, unittest.TestCase): + +class TestGitea(sourcesteps.SourceStepMixin, config.ConfigErrorsMixin, unittest.TestCase, TestReactorMixin): stepClass = Gitea def setUp(self): + self.setUpTestReactor() self.sourceName = self.stepClass.__name__ return self.setUpSourceStep() diff --git a/buildbot_gitea/test/test_webhook.py b/buildbot_gitea/test/test_webhook.py index 2d9ec65..a6e875a 100644 --- a/buildbot_gitea/test/test_webhook.py +++ b/buildbot_gitea/test/test_webhook.py @@ -1,6 +1,8 @@ import buildbot.www.change_hook as change_hook from buildbot.test.fake.web import FakeRequest from buildbot.test.fake.web import fakeMasterForHooks +from buildbot.test.util.misc import TestReactorMixin + from twisted.internet import defer @@ -719,8 +721,9 @@ giteaJsonPullRequestPayloadMerged = rb""" """ -class TestChangeHookGiteaPush(unittest.TestCase): +class TestChangeHookGiteaPush(unittest.TestCase, TestReactorMixin): def setUp(self): + self.setUpTestReactor() self.changeHook = change_hook.ChangeHookResource( dialects={'gitea': {}}, master=fakeMasterForHooks(self)) @@ -828,8 +831,9 @@ class TestChangeHookGiteaPush(unittest.TestCase): self.assertEqual(len(self.changeHook.master.data.updates.changesAdded), 0) -class TestChangeHookGiteaPushOnlySingle(unittest.TestCase): +class TestChangeHookGiteaPushOnlySingle(unittest.TestCase, TestReactorMixin): def setUp(self): + self.setUpTestReactor() self.changeHook = change_hook.ChangeHookResource( dialects={'gitea': {"onlyIncludePushCommit": True}}, master=fakeMasterForHooks(self)) @@ -863,8 +867,9 @@ class TestChangeHookGiteaPushOnlySingle(unittest.TestCase): self.checkChangesFromPush(res) -class TestChangeHookGiteaSecretPhrase(unittest.TestCase): +class TestChangeHookGiteaSecretPhrase(unittest.TestCase, TestReactorMixin): def setUp(self): + self.setUpTestReactor() self.changeHook = change_hook.ChangeHookResource( dialects={'gitea': {"secret": "test"}}, master=fakeMasterForHooks(self))