Skip to content

Commit 92d0f05

Browse files
committed
Mark unsupported tests
1 parent 78565d1 commit 92d0f05

File tree

2 files changed

+60
-15
lines changed

2 files changed

+60
-15
lines changed

Lib/test/support/script_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import os.path
99
import subprocess
1010
import py_compile
11-
import zipfile
11+
# import zipfile XXX RustPython
1212

1313
from importlib.util import source_from_cache
1414
from test.support import make_legacy_pyc, strip_python_stderr

Lib/test/test_exceptions.py

Lines changed: 59 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def raise_catch(self, exc, excname):
4141
self.assertEqual(buf1, buf2)
4242
self.assertEqual(exc.__name__, excname)
4343

44+
@unittest.skip("TODO: RUSTPYTHON")
4445
def testRaising(self):
4546
self.raise_catch(AttributeError, "AttributeError")
4647
self.assertRaises(AttributeError, getattr, sys, "undefined_attribute")
@@ -125,6 +126,8 @@ def testRaising(self):
125126

126127
self.raise_catch(StopAsyncIteration, "StopAsyncIteration")
127128

129+
# TODO: RUSTPYTHON
130+
@unittest.expectedFailure
128131
def testSyntaxErrorMessage(self):
129132
# make sure the right exception message is raised for each of
130133
# these code fragments
@@ -147,6 +150,8 @@ def ckmsg(src, msg):
147150
ckmsg(s, "'continue' not properly in loop")
148151
ckmsg("continue\n", "'continue' not properly in loop")
149152

153+
# TODO: RUSTPYTHON
154+
@unittest.expectedFailure
150155
def testSyntaxErrorMissingParens(self):
151156
def ckmsg(src, msg, exception=SyntaxError):
152157
try:
@@ -175,6 +180,8 @@ def ckmsg(src, msg, exception=SyntaxError):
175180
s = '''if True:\n print()\n\texec "mixed tabs and spaces"'''
176181
ckmsg(s, "inconsistent use of tabs and spaces in indentation", TabError)
177182

183+
# TODO: RUSTPYTHON
184+
@unittest.expectedFailure
178185
def testSyntaxErrorOffset(self):
179186
def check(src, lineno, offset):
180187
with self.assertRaises(SyntaxError) as cm:
@@ -324,6 +331,7 @@ def test_windows_message(self):
324331
with self.assertRaisesRegex(OSError, 'Windows Error 0x%x' % code):
325332
ctypes.pythonapi.PyErr_SetFromWindowsErr(code)
326333

334+
@unittest.skip("TODO: RUSTPYTHON")
327335
def testAttributes(self):
328336
# test that exception attributes are happy
329337

@@ -471,6 +479,8 @@ class MyException(Exception):
471479
self.assertIsInstance(e, MyException)
472480
self.assertEqual(e.__traceback__, tb)
473481

482+
# TODO: RUSTPYTHON
483+
@unittest.expectedFailure
474484
def testInvalidTraceback(self):
475485
try:
476486
Exception().__traceback__ = 5
@@ -479,6 +489,7 @@ def testInvalidTraceback(self):
479489
else:
480490
self.fail("No exception raised")
481491

492+
@unittest.skip("TODO: RUSTPYTHON")
482493
def testInvalidAttrs(self):
483494
self.assertRaises(TypeError, setattr, Exception(), '__cause__', 1)
484495
self.assertRaises(TypeError, delattr, Exception(), '__cause__')
@@ -512,6 +523,8 @@ class MyException(OSError):
512523
self.assertIsNone(e.__context__)
513524
self.assertIsNone(e.__cause__)
514525

526+
# TODO: RUSTPYTHON
527+
@unittest.expectedFailure
515528
def testChainingDescriptors(self):
516529
try:
517530
raise Exception()
@@ -530,6 +543,8 @@ def testChainingDescriptors(self):
530543
e.__suppress_context__ = False
531544
self.assertFalse(e.__suppress_context__)
532545

546+
# TODO: RUSTPYTHON
547+
@unittest.expectedFailure
533548
def testKeywordArgs(self):
534549
# test that builtin exception don't take keyword args,
535550
# but user-defined subclasses can if they want
@@ -572,6 +587,8 @@ def testExceptionCleanupNames(self):
572587
del e
573588
self.assertNotIn('e', locals())
574589

590+
# TODO: RUSTPYTHON
591+
@unittest.expectedFailure
575592
def testExceptionCleanupState(self):
576593
# Make sure exception state is cleaned up as soon as the except
577594
# block is left. See #2507
@@ -699,6 +716,8 @@ def print_error():
699716
print_error()
700717
# implicit "del e" here
701718

719+
# TODO: RUSTPYTHON
720+
@unittest.expectedFailure
702721
def test_generator_leaking(self):
703722
# Test that generator exception state doesn't leak into the calling
704723
# frame
@@ -729,6 +748,8 @@ def yield_raise():
729748
del g
730749
self.assertEqual(sys.exc_info()[0], TypeError)
731750

751+
# TODO: RUSTPYTHON
752+
@unittest.expectedFailure
732753
def test_generator_leaking2(self):
733754
# See issue 12475.
734755
def g():
@@ -744,6 +765,8 @@ def g():
744765
pass
745766
self.assertEqual(sys.exc_info(), (None, None, None))
746767

768+
# TODO: RUSTPYTHON
769+
@unittest.expectedFailure
747770
def test_generator_leaking3(self):
748771
# See issue #23353. When gen.throw() is called, the caller's
749772
# exception state should be save and restored.
@@ -763,6 +786,7 @@ def g():
763786
self.assertIs(gen_exc, e)
764787
self.assertEqual(sys.exc_info(), (None, None, None))
765788

789+
@unittest.skip("TODO: RUSTPYTHON")
766790
def test_generator_leaking4(self):
767791
# See issue #23353. When an exception is raised by a generator,
768792
# the caller's exception state should still be restored.
@@ -790,6 +814,8 @@ def g():
790814
# We used to find TypeError here.
791815
self.assertEqual(sys.exc_info(), (None, None, None))
792816

817+
# TODO: RUSTPYTHON
818+
@unittest.expectedFailure
793819
def test_generator_doesnt_retain_old_exc(self):
794820
def g():
795821
self.assertIsInstance(sys.exc_info()[1], RuntimeError)
@@ -802,6 +828,8 @@ def g():
802828
next(it)
803829
self.assertRaises(StopIteration, next, it)
804830

831+
# TODO: RUSTPYTHON
832+
@unittest.expectedFailure
805833
def test_generator_finalizing_and_exc_info(self):
806834
# See #7173
807835
def simple_gen():
@@ -853,6 +881,8 @@ def do_close(g):
853881
g.close()
854882
self._check_generator_cleanup_exc_state(do_close)
855883

884+
# TODO: RUSTPYTHON
885+
@unittest.expectedFailure
856886
def test_generator_del_cleanup_exc_state(self):
857887
def do_del(g):
858888
g = None
@@ -878,20 +908,22 @@ def do_send(g):
878908
self.fail("should have raised StopIteration")
879909
self._check_generator_cleanup_exc_state(do_send)
880910

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
895927
def test_unicode_change_attributes(self):
896928
# See issue 7309. This was a crasher.
897929

@@ -1147,6 +1179,8 @@ def inner():
11471179
self.fail("MemoryError not raised")
11481180
self.assertEqual(wr(), None)
11491181

1182+
# TODO: RUSTPYTHON
1183+
@unittest.expectedFailure
11501184
@no_tracing
11511185
def test_recursion_error_cleanup(self):
11521186
# Same test as above, but with "recursion exceeded" errors
@@ -1167,12 +1201,15 @@ def inner():
11671201
self.fail("RecursionError not raised")
11681202
self.assertEqual(wr(), None)
11691203

1204+
@unittest.skip("TODO: RUSTPYTHON")
11701205
def test_errno_ENOTDIR(self):
11711206
# Issue #12802: "not a directory" errors are ENOTDIR even on Windows
11721207
with self.assertRaises(OSError) as cm:
11731208
os.listdir(__file__)
11741209
self.assertEqual(cm.exception.errno, errno.ENOTDIR, cm.exception)
11751210

1211+
# TODO: RUSTPYTHON
1212+
@unittest.expectedFailure
11761213
def test_unraisable(self):
11771214
# Issue #22836: PyErr_WriteUnraisable() should give sensible reports
11781215
class BrokenDel:
@@ -1205,6 +1242,7 @@ def __del__(self):
12051242
self.assertIn("del is broken", report)
12061243
self.assertTrue(report.endswith("\n"))
12071244

1245+
@unittest.skip("TODO: RUSTPYTHON")
12081246
def test_unhandled(self):
12091247
# Check for sensible reporting of unhandled exceptions
12101248
for exc_type in (ValueError, BrokenStrException):
@@ -1266,6 +1304,8 @@ def main():
12661304
with self.assertRaises(MainError):
12671305
coro.throw(SubError())
12681306

1307+
# TODO: RUSTPYTHON
1308+
@unittest.expectedFailure
12691309
def test_generator_doesnt_retain_old_exc2(self):
12701310
#Issue 28884#msg282532
12711311
def g():
@@ -1302,6 +1342,8 @@ def g():
13021342

13031343
class ImportErrorTests(unittest.TestCase):
13041344

1345+
# TODO: RUSTPYTHON
1346+
@unittest.expectedFailure
13051347
def test_attributes(self):
13061348
# Setting 'name' and 'path' should not be a problem.
13071349
exc = ImportError('test')
@@ -1336,6 +1378,8 @@ def test_attributes(self):
13361378
with self.assertRaisesRegex(TypeError, msg):
13371379
ImportError('test', invalid='keyword', another=True)
13381380

1381+
# TODO: RUSTPYTHON
1382+
@unittest.expectedFailure
13391383
def test_reset_attributes(self):
13401384
exc = ImportError('test', name='name', path='path')
13411385
self.assertEqual(exc.args, ('test',))
@@ -1357,6 +1401,7 @@ def test_non_str_argument(self):
13571401
exc = ImportError(arg)
13581402
self.assertEqual(str(arg), str(exc))
13591403

1404+
@unittest.skip("TODO: RUSTPYTHON")
13601405
def test_copy_pickle(self):
13611406
for kwargs in (dict(),
13621407
dict(name='somename'),

0 commit comments

Comments
 (0)