Make testprocess test more stable.

This commit is contained in:
Florian Bruhin 2015-11-06 07:17:15 +01:00
parent 25ecd9068c
commit 4c2e92c998

View File

@ -114,9 +114,8 @@ class TestWaitFor:
"""Make sure the message of a previous test gets ignored."""
pyproc.code = "print('foobar')"
pyproc.start()
# We can't use wait_for here, as that'd actually test what the next
# test does.
time.sleep(0.5)
line = pyproc.wait_for(data="foobar")
line.waited_for = False # so we don't test what the next test does
pyproc.after_test()
with pytest.raises(testprocess.WaitForTimeout):
pyproc.wait_for(data="foobar", timeout=100)