def test_waitUntilLockedWithTimeoutLocked(self):
        """
        Test that the lock can not be acquired when the lock is held
        for longer than the timeout.
        """
        self.assertTrue(self.lock.lock())

        d = self.lock.deferUntilLocked(timeout=5.5)
        self.assertFailure(d, defer.TimeoutError)

        self.clock.pump([1] * 10)

        return d

        Test that the lock can not be acquired when the lock is held
        for longer than the timeout.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_defer.py