diff --git a/server/report-receiver/test_receiver.py b/server/report-receiver/test_receiver.py index bb67c56..328e0e6 100644 --- a/server/report-receiver/test_receiver.py +++ b/server/report-receiver/test_receiver.py @@ -3,8 +3,10 @@ They start the receiver on a free port with a fake Gitea, and send it reports with the real `report` client, the way a CoreDesktop machine would.""" +import contextlib import gzip import http.server +import io import json import os import shutil @@ -66,6 +68,10 @@ class FakeGitea: class ReceiverTest(unittest.TestCase): def setUp(self): + # Keep what the receiver logs ("filed as issue #1", ...) out of the + # test results. It's in self.stderr for a test that wants to check it. + self.stderr = io.StringIO() + self.enterContext(contextlib.redirect_stderr(self.stderr)) self.tmp = Path(tempfile.mkdtemp()) self.gitea = FakeGitea() self.store = receiver.Store(self.tmp / "state", receiver.Gitea(self.gitea.url, "Federated_Computer/coredesktop-reports", "secret"))