From dcd486da875fdab241815479d9bd3873d4d2a682 Mon Sep 17 00:00:00 2001 From: MrKevinWeiss Date: Mon, 8 Mar 2021 11:47:05 +0100 Subject: [PATCH] tests: Slow down readline_to_delim --- tests/test_serial_driver.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/test_serial_driver.py b/tests/test_serial_driver.py index fe86d57..f3672ca 100644 --- a/tests/test_serial_driver.py +++ b/tests/test_serial_driver.py @@ -101,15 +101,17 @@ def test_readline_to_delim(mock_lb, ser_dri): ser_dri.writeline("foo") ser_dri.writeline("bar") - ser_dri.writeline("DELIM") - sleep(0.3) - lines = ser_dri.readlines_to_delim(delim="DELIM") - assert lines == "foo\nbar\n" + with pytest.raises(TimeoutError): + ser_dri.readlines_to_delim() + +def test_readline_to_diff_delim(mock_lb, ser_dri): ser_dri.writeline("foo") ser_dri.writeline("bar") - with pytest.raises(TimeoutError): - ser_dri.readlines_to_delim() + ser_dri.writeline("$$$") + lines = ser_dri.readlines_to_delim(delim="$$$") + sleep(0.3) + assert lines == "foo\nbar\n" def test_read(mock_lb, ser_dri):