From cb993bdcff86ff9b5dbebcfcddba8fe482e10503 Mon Sep 17 00:00:00 2001 From: skelly37 Date: Mon, 27 Jun 2022 10:26:22 +0200 Subject: [PATCH] simplified test reader --- test/test_util_pipe.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/test/test_util_pipe.py b/test/test_util_pipe.py index 7008241ad..a1c16cbbe 100644 --- a/test/test_util_pipe.py +++ b/test/test_util_pipe.py @@ -28,16 +28,10 @@ from picard.util import pipe def pipe_listener(pipe_handler): - IGNORED_OUTPUT = {pipe.Pipe.MESSAGE_TO_IGNORE, pipe.Pipe.NO_RESPONSE_MESSAGE} - received = "" - - while not received: + while True: for message in pipe_handler.read_from_pipe(): - if message not in IGNORED_OUTPUT: - received = message - break - - return received + if message != pipe.Pipe.NO_RESPONSE_MESSAGE: + return message def pipe_writer(pipe_handler, to_send): @@ -80,7 +74,7 @@ class TestPipe(PicardTestCase): for message in to_send: plistener = __pool.submit(pipe_listener, pipe_listener_handler) pwriter = __pool.submit(pipe_writer, pipe_writer_handler, message) - res = [] + res = "" # handle the write/read processes try: