summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_locks.py
diff options
context:
space:
mode:
authorSteele Farnsworth <swfarnsworth@gmail.com>2024-06-17 14:48:17 (GMT)
committerGitHub <noreply@github.com>2024-06-17 14:48:17 (GMT)
commit2c7209a3bdf81a289ccd6b80a77497cfcd5732de (patch)
treec17030b4b85ca4bd6db48f2764b6e3279933d61e /Lib/test/test_asyncio/test_locks.py
parenta26d27e7ee512cd822b7a7ba075171152779ffdd (diff)
downloadcpython-2c7209a3bdf81a289ccd6b80a77497cfcd5732de.zip
cpython-2c7209a3bdf81a289ccd6b80a77497cfcd5732de.tar.gz
cpython-2c7209a3bdf81a289ccd6b80a77497cfcd5732de.tar.bz2
gh-114091: Reword error message for unawaitable types (#114090)
Reword error message for unawaitable types.
Diffstat (limited to 'Lib/test/test_asyncio/test_locks.py')
-rw-r--r--Lib/test/test_asyncio/test_locks.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_asyncio/test_locks.py b/Lib/test/test_asyncio/test_locks.py
index c961dad..3450971 100644
--- a/Lib/test/test_asyncio/test_locks.py
+++ b/Lib/test/test_asyncio/test_locks.py
@@ -39,7 +39,7 @@ class LockTests(unittest.IsolatedAsyncioTestCase):
with self.assertRaisesRegex(
TypeError,
- "object Lock can't be used in 'await' expression"
+ "'Lock' object can't be awaited"
):
await lock
@@ -77,7 +77,7 @@ class LockTests(unittest.IsolatedAsyncioTestCase):
self.assertFalse(lock.locked())
with self.assertRaisesRegex(
TypeError,
- r"object \w+ can't be used in 'await' expression"
+ r"'\w+' object can't be awaited"
):
with await lock:
pass
@@ -941,7 +941,7 @@ class SemaphoreTests(unittest.IsolatedAsyncioTestCase):
with self.assertRaisesRegex(
TypeError,
- "object Semaphore can't be used in 'await' expression",
+ "'Semaphore' object can't be awaited",
):
await sem
@@ -1270,7 +1270,7 @@ class BarrierTests(unittest.IsolatedAsyncioTestCase):
self.assertIn("filling", repr(barrier))
with self.assertRaisesRegex(
TypeError,
- "object Barrier can't be used in 'await' expression",
+ "'Barrier' object can't be awaited",
):
await barrier