def test_concurrentUsage(self):
        """
        Test that an appropriate exception is raised when attempting
        to use deferUntilLocked concurrently.
        """
        self.lock.lock()
        self.clock.callLater(1, self.lock.unlock)

        d = self.lock.deferUntilLocked()
        d2 = self.lock.deferUntilLocked()

        self.assertFailure(d2, defer.AlreadyTryingToLockError)

        self.clock.advance(1)

        return d

        Test that an appropriate exception is raised when attempting
        to use deferUntilLocked concurrently.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_defer.py