Skip to content

Commit e983506

Browse files
CPython Developersdalinaum
authored andcommitted
Update test/test_with.py from CPython 3.11.2
1 parent 26a3ec9 commit e983506

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/test/test_with.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def __exit__(self, type, value, traceback):
117117
def fooLacksEnter():
118118
foo = LacksEnter()
119119
with foo: pass
120-
self.assertRaisesRegex(AttributeError, '__enter__', fooLacksEnter)
120+
self.assertRaisesRegex(TypeError, 'the context manager', fooLacksEnter)
121121

122122
def testEnterAttributeError2(self):
123123
class LacksEnterAndExit(object):
@@ -126,7 +126,7 @@ class LacksEnterAndExit(object):
126126
def fooLacksEnterAndExit():
127127
foo = LacksEnterAndExit()
128128
with foo: pass
129-
self.assertRaisesRegex(AttributeError, '__enter__', fooLacksEnterAndExit)
129+
self.assertRaisesRegex(TypeError, 'the context manager', fooLacksEnterAndExit)
130130

131131
def testExitAttributeError(self):
132132
class LacksExit(object):
@@ -136,7 +136,7 @@ def __enter__(self):
136136
def fooLacksExit():
137137
foo = LacksExit()
138138
with foo: pass
139-
self.assertRaisesRegex(AttributeError, '__exit__', fooLacksExit)
139+
self.assertRaisesRegex(TypeError, 'the context manager.*__exit__', fooLacksExit)
140140

141141
def assertRaisesSyntaxError(self, codestr):
142142
def shouldRaiseSyntaxError(s):

0 commit comments

Comments
 (0)