Commit 6252c0bd authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Add tests for __repr__ in locking classes

“locking.PipeCondition” and “locking.SharedLock” define “__repr__”,
which until now was not tested at all.
Signed-off-by: default avatarMichael Hanselmann <>
Reviewed-by: default avatarGuido Trotter <>
parent 8c114acd
......@@ -187,6 +187,10 @@ class TestPipeCondition(_ConditionTestCase):
self.assertEqual(len(self.cond._waiters), 3)
self.assertEqual(self.cond._waiters, set(threads))
self.assertTrue("waiters=" in repr(self.cond))
# This new thread can't acquire the lock, and thus call wait, before we
# release it
......@@ -268,6 +272,9 @@ class TestSharedLock(_ThreadedTestCase):
_ThreadedTestCase.setUp(self) = locking.SharedLock("TestSharedLock")
self.assertTrue("name=TestSharedLock" in repr(
def testSequenceAndOwnership(self):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment