summaryrefslogtreecommitdiff
path: root/Lib/test/test_contextlib.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_contextlib.py')
-rw-r--r--Lib/test/test_contextlib.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_contextlib.py b/Lib/test/test_contextlib.py
index 453ef6c9f0..dbc3f5fbe2 100644
--- a/Lib/test/test_contextlib.py
+++ b/Lib/test/test_contextlib.py
@@ -491,7 +491,7 @@ class TestContextDecorator(unittest.TestCase):
def __exit__(self, *exc):
pass
- with self.assertRaises(AttributeError):
+ with self.assertRaisesRegex(TypeError, 'the context manager'):
with mycontext():
pass
@@ -503,7 +503,7 @@ class TestContextDecorator(unittest.TestCase):
def __uxit__(self, *exc):
pass
- with self.assertRaises(AttributeError):
+ with self.assertRaisesRegex(TypeError, 'the context manager.*__exit__'):
with mycontext():
pass