def METHOD_NAME(self):
    with self.assertWarns(DeprecationWarning):
        primitives = [
            asyncio.Lock(loop=self.loop),
            asyncio.Condition(loop=self.loop),
            asyncio.Semaphore(loop=self.loop),
            asyncio.BoundedSemaphore(loop=self.loop),
        ]
    async def test(lock):
        await asyncio.sleep(0.01)
        self.assertFalse(lock.locked())
        with self.assertWarns(DeprecationWarning):
            with await lock as _lock:
                self.assertIs(_lock, None)
                self.assertTrue(lock.locked())
                await asyncio.sleep(0.01)
                self.assertTrue(lock.locked())
            self.assertFalse(lock.locked())
    for primitive in primitives:
        self.loop.run_until_complete(test(primitive))
        self.assertFalse(primitive.locked())