@@ -41,6 +41,7 @@ def raise_catch(self, exc, excname):
41
41
self .assertEqual (buf1 , buf2 )
42
42
self .assertEqual (exc .__name__ , excname )
43
43
44
+ @unittest .skip ("TODO: RUSTPYTHON" )
44
45
def testRaising (self ):
45
46
self .raise_catch (AttributeError , "AttributeError" )
46
47
self .assertRaises (AttributeError , getattr , sys , "undefined_attribute" )
@@ -125,6 +126,8 @@ def testRaising(self):
125
126
126
127
self .raise_catch (StopAsyncIteration , "StopAsyncIteration" )
127
128
129
+ # TODO: RUSTPYTHON
130
+ @unittest .expectedFailure
128
131
def testSyntaxErrorMessage (self ):
129
132
# make sure the right exception message is raised for each of
130
133
# these code fragments
@@ -147,6 +150,8 @@ def ckmsg(src, msg):
147
150
ckmsg (s , "'continue' not properly in loop" )
148
151
ckmsg ("continue\n " , "'continue' not properly in loop" )
149
152
153
+ # TODO: RUSTPYTHON
154
+ @unittest .expectedFailure
150
155
def testSyntaxErrorMissingParens (self ):
151
156
def ckmsg (src , msg , exception = SyntaxError ):
152
157
try :
@@ -175,6 +180,8 @@ def ckmsg(src, msg, exception=SyntaxError):
175
180
s = '''if True:\n print()\n \t exec "mixed tabs and spaces"'''
176
181
ckmsg (s , "inconsistent use of tabs and spaces in indentation" , TabError )
177
182
183
+ # TODO: RUSTPYTHON
184
+ @unittest .expectedFailure
178
185
def testSyntaxErrorOffset (self ):
179
186
def check (src , lineno , offset ):
180
187
with self .assertRaises (SyntaxError ) as cm :
@@ -324,6 +331,7 @@ def test_windows_message(self):
324
331
with self .assertRaisesRegex (OSError , 'Windows Error 0x%x' % code ):
325
332
ctypes .pythonapi .PyErr_SetFromWindowsErr (code )
326
333
334
+ @unittest .skip ("TODO: RUSTPYTHON" )
327
335
def testAttributes (self ):
328
336
# test that exception attributes are happy
329
337
@@ -471,6 +479,8 @@ class MyException(Exception):
471
479
self .assertIsInstance (e , MyException )
472
480
self .assertEqual (e .__traceback__ , tb )
473
481
482
+ # TODO: RUSTPYTHON
483
+ @unittest .expectedFailure
474
484
def testInvalidTraceback (self ):
475
485
try :
476
486
Exception ().__traceback__ = 5
@@ -479,6 +489,7 @@ def testInvalidTraceback(self):
479
489
else :
480
490
self .fail ("No exception raised" )
481
491
492
+ @unittest .skip ("TODO: RUSTPYTHON" )
482
493
def testInvalidAttrs (self ):
483
494
self .assertRaises (TypeError , setattr , Exception (), '__cause__' , 1 )
484
495
self .assertRaises (TypeError , delattr , Exception (), '__cause__' )
@@ -512,6 +523,8 @@ class MyException(OSError):
512
523
self .assertIsNone (e .__context__ )
513
524
self .assertIsNone (e .__cause__ )
514
525
526
+ # TODO: RUSTPYTHON
527
+ @unittest .expectedFailure
515
528
def testChainingDescriptors (self ):
516
529
try :
517
530
raise Exception ()
@@ -530,6 +543,8 @@ def testChainingDescriptors(self):
530
543
e .__suppress_context__ = False
531
544
self .assertFalse (e .__suppress_context__ )
532
545
546
+ # TODO: RUSTPYTHON
547
+ @unittest .expectedFailure
533
548
def testKeywordArgs (self ):
534
549
# test that builtin exception don't take keyword args,
535
550
# but user-defined subclasses can if they want
@@ -572,6 +587,8 @@ def testExceptionCleanupNames(self):
572
587
del e
573
588
self .assertNotIn ('e' , locals ())
574
589
590
+ # TODO: RUSTPYTHON
591
+ @unittest .expectedFailure
575
592
def testExceptionCleanupState (self ):
576
593
# Make sure exception state is cleaned up as soon as the except
577
594
# block is left. See #2507
@@ -699,6 +716,8 @@ def print_error():
699
716
print_error ()
700
717
# implicit "del e" here
701
718
719
+ # TODO: RUSTPYTHON
720
+ @unittest .expectedFailure
702
721
def test_generator_leaking (self ):
703
722
# Test that generator exception state doesn't leak into the calling
704
723
# frame
@@ -729,6 +748,8 @@ def yield_raise():
729
748
del g
730
749
self .assertEqual (sys .exc_info ()[0 ], TypeError )
731
750
751
+ # TODO: RUSTPYTHON
752
+ @unittest .expectedFailure
732
753
def test_generator_leaking2 (self ):
733
754
# See issue 12475.
734
755
def g ():
@@ -744,6 +765,8 @@ def g():
744
765
pass
745
766
self .assertEqual (sys .exc_info (), (None , None , None ))
746
767
768
+ # TODO: RUSTPYTHON
769
+ @unittest .expectedFailure
747
770
def test_generator_leaking3 (self ):
748
771
# See issue #23353. When gen.throw() is called, the caller's
749
772
# exception state should be save and restored.
@@ -763,6 +786,7 @@ def g():
763
786
self .assertIs (gen_exc , e )
764
787
self .assertEqual (sys .exc_info (), (None , None , None ))
765
788
789
+ @unittest .skip ("TODO: RUSTPYTHON" )
766
790
def test_generator_leaking4 (self ):
767
791
# See issue #23353. When an exception is raised by a generator,
768
792
# the caller's exception state should still be restored.
@@ -790,6 +814,8 @@ def g():
790
814
# We used to find TypeError here.
791
815
self .assertEqual (sys .exc_info (), (None , None , None ))
792
816
817
+ # TODO: RUSTPYTHON
818
+ @unittest .expectedFailure
793
819
def test_generator_doesnt_retain_old_exc (self ):
794
820
def g ():
795
821
self .assertIsInstance (sys .exc_info ()[1 ], RuntimeError )
@@ -802,6 +828,8 @@ def g():
802
828
next (it )
803
829
self .assertRaises (StopIteration , next , it )
804
830
831
+ # TODO: RUSTPYTHON
832
+ @unittest .expectedFailure
805
833
def test_generator_finalizing_and_exc_info (self ):
806
834
# See #7173
807
835
def simple_gen ():
@@ -853,6 +881,8 @@ def do_close(g):
853
881
g .close ()
854
882
self ._check_generator_cleanup_exc_state (do_close )
855
883
884
+ # TODO: RUSTPYTHON
885
+ @unittest .expectedFailure
856
886
def test_generator_del_cleanup_exc_state (self ):
857
887
def do_del (g ):
858
888
g = None
@@ -878,20 +908,22 @@ def do_send(g):
878
908
self .fail ("should have raised StopIteration" )
879
909
self ._check_generator_cleanup_exc_state (do_send )
880
910
881
- def test_3114 (self ):
882
- # Bug #3114: in its destructor, MyObject retrieves a pointer to
883
- # obsolete and/or deallocated objects.
884
- class MyObject :
885
- def __del__ (self ):
886
- nonlocal e
887
- e = sys .exc_info ()
888
- e = ()
889
- try :
890
- raise Exception (MyObject ())
891
- except :
892
- pass
893
- self .assertEqual (e , (None , None , None ))
894
-
911
+ # def test_3114(self):
912
+ # # Bug #3114: in its destructor, MyObject retrieves a pointer to
913
+ # # obsolete and/or deallocated objects.
914
+ # class MyObject:
915
+ # def __del__(self):
916
+ # nonlocal e
917
+ # e = sys.exc_info()
918
+ # e = ()
919
+ # try:
920
+ # raise Exception(MyObject())
921
+ # except:
922
+ # pass
923
+ # self.assertEqual(e, (None, None, None))
924
+
925
+ # TODO: RUSTPYTHON
926
+ @unittest .expectedFailure
895
927
def test_unicode_change_attributes (self ):
896
928
# See issue 7309. This was a crasher.
897
929
@@ -1147,6 +1179,8 @@ def inner():
1147
1179
self .fail ("MemoryError not raised" )
1148
1180
self .assertEqual (wr (), None )
1149
1181
1182
+ # TODO: RUSTPYTHON
1183
+ @unittest .expectedFailure
1150
1184
@no_tracing
1151
1185
def test_recursion_error_cleanup (self ):
1152
1186
# Same test as above, but with "recursion exceeded" errors
@@ -1167,12 +1201,15 @@ def inner():
1167
1201
self .fail ("RecursionError not raised" )
1168
1202
self .assertEqual (wr (), None )
1169
1203
1204
+ @unittest .skip ("TODO: RUSTPYTHON" )
1170
1205
def test_errno_ENOTDIR (self ):
1171
1206
# Issue #12802: "not a directory" errors are ENOTDIR even on Windows
1172
1207
with self .assertRaises (OSError ) as cm :
1173
1208
os .listdir (__file__ )
1174
1209
self .assertEqual (cm .exception .errno , errno .ENOTDIR , cm .exception )
1175
1210
1211
+ # TODO: RUSTPYTHON
1212
+ @unittest .expectedFailure
1176
1213
def test_unraisable (self ):
1177
1214
# Issue #22836: PyErr_WriteUnraisable() should give sensible reports
1178
1215
class BrokenDel :
@@ -1205,6 +1242,7 @@ def __del__(self):
1205
1242
self .assertIn ("del is broken" , report )
1206
1243
self .assertTrue (report .endswith ("\n " ))
1207
1244
1245
+ @unittest .skip ("TODO: RUSTPYTHON" )
1208
1246
def test_unhandled (self ):
1209
1247
# Check for sensible reporting of unhandled exceptions
1210
1248
for exc_type in (ValueError , BrokenStrException ):
@@ -1266,6 +1304,8 @@ def main():
1266
1304
with self .assertRaises (MainError ):
1267
1305
coro .throw (SubError ())
1268
1306
1307
+ # TODO: RUSTPYTHON
1308
+ @unittest .expectedFailure
1269
1309
def test_generator_doesnt_retain_old_exc2 (self ):
1270
1310
#Issue 28884#msg282532
1271
1311
def g ():
@@ -1302,6 +1342,8 @@ def g():
1302
1342
1303
1343
class ImportErrorTests (unittest .TestCase ):
1304
1344
1345
+ # TODO: RUSTPYTHON
1346
+ @unittest .expectedFailure
1305
1347
def test_attributes (self ):
1306
1348
# Setting 'name' and 'path' should not be a problem.
1307
1349
exc = ImportError ('test' )
@@ -1336,6 +1378,8 @@ def test_attributes(self):
1336
1378
with self .assertRaisesRegex (TypeError , msg ):
1337
1379
ImportError ('test' , invalid = 'keyword' , another = True )
1338
1380
1381
+ # TODO: RUSTPYTHON
1382
+ @unittest .expectedFailure
1339
1383
def test_reset_attributes (self ):
1340
1384
exc = ImportError ('test' , name = 'name' , path = 'path' )
1341
1385
self .assertEqual (exc .args , ('test' ,))
@@ -1357,6 +1401,7 @@ def test_non_str_argument(self):
1357
1401
exc = ImportError (arg )
1358
1402
self .assertEqual (str (arg ), str (exc ))
1359
1403
1404
+ @unittest .skip ("TODO: RUSTPYTHON" )
1360
1405
def test_copy_pickle (self ):
1361
1406
for kwargs in (dict (),
1362
1407
dict (name = 'somename' ),
0 commit comments