Skip to content

Commit

Permalink
Merge pull request #15 from MrKevinWeiss/pr/fixtests
Browse files Browse the repository at this point in the history
tests: Slow down readline_to_delim
  • Loading branch information
MrKevinWeiss authored Mar 8, 2021
2 parents c38e228 + dcd486d commit 1620917
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tests/test_serial_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 1620917

Please sign in to comment.