def test_reentrant_switch(self): switch = _LightSwitch() testLock = threading.Lock() switch.acquire(testLock) switch.acquire(testLock) switch.release(testLock) switch.release(testLock)
def test_overrelease(self): switch = _LightSwitch() testLock = threading.Lock() switch.acquire(testLock) switch.release(testLock) self.assertRaises(RuntimeError, switch.release, testLock)