diff options
author | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2011-08-15 13:12:09 +0000 |
---|---|---|
committer | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2011-08-15 13:12:09 +0000 |
commit | ac3084b841dfb414ab029f827ab7e3e48b941a45 (patch) | |
tree | 75962865b5431670058a8386f962be7b48573bc8 | |
parent | ccdafe22ec795997484d2ccfaa7e3a5b60a5b80d (diff) | |
download | pyserial-ac3084b841dfb414ab029f827ab7e3e48b941a45.tar.gz |
fix race condition in test
git-svn-id: http://svn.code.sf.net/p/pyserial/code/trunk/pyserial@409 f19166aa-fa4f-0410-85c2-fa1106f25c8a
-rw-r--r-- | test/test.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/test.py b/test/test.py index c37f330..25a34c3 100644 --- a/test/test.py +++ b/test/test.py @@ -107,10 +107,10 @@ class SendEvent(threading.Thread): def run(self): time.sleep(self.delay) + self.x.set() if not self.stopped: self.serial.write(data("E")) self.serial.flush() - self.x.set() def isSet(self): return self.x.isSet() @@ -136,7 +136,7 @@ class Test1_Forever(unittest.TestCase): a character is sent after some time to terminate the test (SendEvent).""" c = self.s.read(1) if not (self.event.isSet() and c == data('E')): - self.fail("expected marker") + self.fail("expected marker (evt=%r, c=%r)" % (self.event.isSet(), c)) class Test2_Forever(unittest.TestCase): |