diff options
Diffstat (limited to 'Lib/test/test_coroutines.py')
-rw-r--r-- | Lib/test/test_coroutines.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_coroutines.py b/Lib/test/test_coroutines.py index a6a199e..9b83244 100644 --- a/Lib/test/test_coroutines.py +++ b/Lib/test/test_coroutines.py @@ -1212,7 +1212,7 @@ class CoroutineTest(unittest.TestCase): async with CM(): body_executed = True - with self.assertRaisesRegex(AttributeError, '__aexit__'): + with self.assertRaisesRegex(TypeError, 'asynchronous context manager.*__aexit__'): run_async(foo()) self.assertIs(body_executed, False) @@ -1228,7 +1228,7 @@ class CoroutineTest(unittest.TestCase): async with CM(): body_executed = True - with self.assertRaisesRegex(AttributeError, '__aenter__'): + with self.assertRaisesRegex(TypeError, 'asynchronous context manager'): run_async(foo()) self.assertIs(body_executed, False) @@ -1243,7 +1243,7 @@ class CoroutineTest(unittest.TestCase): async with CM(): body_executed = True - with self.assertRaisesRegex(AttributeError, '__aenter__'): + with self.assertRaisesRegex(TypeError, 'asynchronous context manager'): run_async(foo()) self.assertIs(body_executed, False) |