@@ -109,6 +109,8 @@ def fooNotDeclared():
109109 with foo : pass
110110 self .assertRaises (NameError , fooNotDeclared )
111111
112+ # TODO: RUSTPYTHON
113+ @unittest .expectedFailure
112114 def testEnterAttributeError1 (self ):
113115 class LacksEnter (object ):
114116 def __exit__ (self , type , value , traceback ):
@@ -117,17 +119,21 @@ def __exit__(self, type, value, traceback):
117119 def fooLacksEnter ():
118120 foo = LacksEnter ()
119121 with foo : pass
120- self .assertRaisesRegex (AttributeError , '__enter__ ' , fooLacksEnter )
122+ self .assertRaisesRegex (TypeError , 'the context manager ' , fooLacksEnter )
121123
124+ # TODO: RUSTPYTHON
125+ @unittest .expectedFailure
122126 def testEnterAttributeError2 (self ):
123127 class LacksEnterAndExit (object ):
124128 pass
125129
126130 def fooLacksEnterAndExit ():
127131 foo = LacksEnterAndExit ()
128132 with foo : pass
129- self .assertRaisesRegex (AttributeError , '__enter__ ' , fooLacksEnterAndExit )
133+ self .assertRaisesRegex (TypeError , 'the context manager ' , fooLacksEnterAndExit )
130134
135+ # TODO: RUSTPYTHON
136+ @unittest .expectedFailure
131137 def testExitAttributeError (self ):
132138 class LacksExit (object ):
133139 def __enter__ (self ):
@@ -136,7 +142,7 @@ def __enter__(self):
136142 def fooLacksExit ():
137143 foo = LacksExit ()
138144 with foo : pass
139- self .assertRaisesRegex (AttributeError , '__exit__' , fooLacksExit )
145+ self .assertRaisesRegex (TypeError , 'the context manager.* __exit__' , fooLacksExit )
140146
141147 def assertRaisesSyntaxError (self , codestr ):
142148 def shouldRaiseSyntaxError (s ):
0 commit comments