Skip to content

Commit 6ff41a2

Browse files
committed
mark failing tests
1 parent 66afb64 commit 6ff41a2

File tree

1 file changed

+73
-1
lines changed

1 file changed

+73
-1
lines changed

Lib/test/test_marshal.py

Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def test_ints(self):
3535
self.helper(expected)
3636
n = n >> 1
3737

38+
@unittest.skip("TODO: RUSTPYTHON; hang")
3839
def test_int64(self):
3940
# Simulate int marshaling with TYPE_INT64.
4041
maxint64 = (1 << 63) - 1
@@ -63,6 +64,8 @@ def test_bool(self):
6364
self.helper(b)
6465

6566
class FloatTestCase(unittest.TestCase, HelperMixin):
67+
# TODO: RUSTPYTHON
68+
@unittest.expectedFailure
6669
def test_floats(self):
6770
# Test a few floats
6871
small = 1e-25
@@ -90,24 +93,34 @@ def test_floats(self):
9093
n *= 123.4567
9194

9295
class StringTestCase(unittest.TestCase, HelperMixin):
96+
# TODO: RUSTPYTHON
97+
@unittest.expectedFailure
9398
def test_unicode(self):
9499
for s in ["", "Andr\xe8 Previn", "abc", " "*10000]:
95100
self.helper(marshal.loads(marshal.dumps(s)))
96101

102+
# TODO: RUSTPYTHON
103+
@unittest.expectedFailure
97104
def test_string(self):
98105
for s in ["", "Andr\xe8 Previn", "abc", " "*10000]:
99106
self.helper(s)
100107

108+
# TODO: RUSTPYTHON
109+
@unittest.expectedFailure
101110
def test_bytes(self):
102111
for s in [b"", b"Andr\xe8 Previn", b"abc", b" "*10000]:
103112
self.helper(s)
104113

105114
class ExceptionTestCase(unittest.TestCase):
115+
# TODO: RUSTPYTHON
116+
@unittest.expectedFailure
106117
def test_exceptions(self):
107118
new = marshal.loads(marshal.dumps(StopIteration))
108119
self.assertEqual(StopIteration, new)
109120

110121
class CodeTestCase(unittest.TestCase):
122+
# TODO: RUSTPYTHON
123+
@unittest.expectedFailure
111124
def test_code(self):
112125
co = ExceptionTestCase.test_exceptions.__code__
113126
new = marshal.loads(marshal.dumps(co))
@@ -146,9 +159,13 @@ class ContainerTestCase(unittest.TestCase, HelperMixin):
146159
'aunicode': "Andr\xe8 Previn"
147160
}
148161

162+
# TODO: RUSTPYTHON
163+
@unittest.expectedFailure
149164
def test_dict(self):
150165
self.helper(self.d)
151166

167+
# TODO: RUSTPYTHON
168+
@unittest.expectedFailure
152169
def test_list(self):
153170
self.helper(list(self.d.items()))
154171

@@ -161,19 +178,24 @@ def test_sets(self):
161178

162179

163180
class BufferTestCase(unittest.TestCase, HelperMixin):
164-
181+
# TODO: RUSTPYTHON
182+
@unittest.expectedFailure
165183
def test_bytearray(self):
166184
b = bytearray(b"abc")
167185
self.helper(b)
168186
new = marshal.loads(marshal.dumps(b))
169187
self.assertEqual(type(new), bytes)
170188

189+
# TODO: RUSTPYTHON
190+
@unittest.expectedFailure
171191
def test_memoryview(self):
172192
b = memoryview(b"abc")
173193
self.helper(b)
174194
new = marshal.loads(marshal.dumps(b))
175195
self.assertEqual(type(new), bytes)
176196

197+
# TODO: RUSTPYTHON
198+
@unittest.expectedFailure
177199
def test_array(self):
178200
a = array.array('B', b"abc")
179201
new = marshal.loads(marshal.dumps(a))
@@ -190,11 +212,14 @@ def test_patch_873224(self):
190212
self.assertRaises(Exception, marshal.loads, b'f')
191213
self.assertRaises(Exception, marshal.loads, marshal.dumps(2**65)[:-1])
192214

215+
# TODO: RUSTPYTHON
216+
@unittest.expectedFailure
193217
def test_version_argument(self):
194218
# Python 2.4.0 crashes for any call to marshal.dumps(x, y)
195219
self.assertEqual(marshal.loads(marshal.dumps(5, 0)), 5)
196220
self.assertEqual(marshal.loads(marshal.dumps(5, 1)), 5)
197221

222+
@unittest.skip("TODO: RUSTPYTHON; panic")
198223
def test_fuzz(self):
199224
# simple test that it's at least not *totally* trivial to
200225
# crash from bad marshal data
@@ -205,6 +230,8 @@ def test_fuzz(self):
205230
except Exception:
206231
pass
207232

233+
# TODO: RUSTPYTHON
234+
@unittest.expectedFailure
208235
def test_loads_recursion(self):
209236
def run_tests(N, check):
210237
# (((...None...),),)
@@ -224,6 +251,7 @@ def check(s):
224251
self.assertRaises(ValueError, marshal.loads, s)
225252
run_tests(2**20, check)
226253

254+
@unittest.skip("TODO: RUSTPYTHON; segfault")
227255
def test_recursion_limit(self):
228256
# Create a deeply nested structure.
229257
head = last = []
@@ -250,6 +278,8 @@ def test_recursion_limit(self):
250278
last.append([0])
251279
self.assertRaises(ValueError, marshal.dumps, head)
252280

281+
# TODO: RUSTPYTHON
282+
@unittest.expectedFailure
253283
def test_exact_type_match(self):
254284
# Former bug:
255285
# >>> class Int(int): pass
@@ -268,11 +298,15 @@ def test_large_marshal(self):
268298
testString = 'abc' * size
269299
marshal.dumps(testString)
270300

301+
# TODO: RUSTPYTHON
302+
@unittest.expectedFailure
271303
def test_invalid_longs(self):
272304
# Issue #7019: marshal.loads shouldn't produce unnormalized PyLongs
273305
invalid_string = b'l\x02\x00\x00\x00\x00\x00\x00\x00'
274306
self.assertRaises(ValueError, marshal.loads, invalid_string)
275307

308+
# TODO: RUSTPYTHON
309+
@unittest.expectedFailure
276310
def test_multiple_dumps_and_loads(self):
277311
# Issue 12291: marshal.load() should be callable multiple times
278312
# with interleaved data written by non-marshal code
@@ -302,6 +336,8 @@ def test_loads_reject_unicode_strings(self):
302336
unicode_string = 'T'
303337
self.assertRaises(TypeError, marshal.loads, unicode_string)
304338

339+
# TODO: RUSTPYTHON
340+
@unittest.expectedFailure
305341
def test_bad_reader(self):
306342
class BadReader(io.BytesIO):
307343
def readinto(self, buf):
@@ -313,6 +349,8 @@ def readinto(self, buf):
313349
self.assertRaises(ValueError, marshal.load,
314350
BadReader(marshal.dumps(value)))
315351

352+
# TODO: RUSTPYTHON
353+
@unittest.expectedFailure
316354
def test_eof(self):
317355
data = marshal.dumps(("hello", "dolly", None))
318356
for i in range(len(data)):
@@ -405,56 +443,76 @@ def helper3(self, rsample, recursive=False, simple=False):
405443
else:
406444
self.assertGreaterEqual(len(s2), len(s3))
407445

446+
# TODO: RUSTPYTHON
447+
@unittest.expectedFailure
408448
def testInt(self):
409449
intobj = 123321
410450
self.helper(intobj)
411451
self.helper3(intobj, simple=True)
412452

453+
# TODO: RUSTPYTHON
454+
@unittest.expectedFailure
413455
def testFloat(self):
414456
floatobj = 1.2345
415457
self.helper(floatobj)
416458
self.helper3(floatobj)
417459

460+
# TODO: RUSTPYTHON
461+
@unittest.expectedFailure
418462
def testStr(self):
419463
strobj = "abcde"*3
420464
self.helper(strobj)
421465
self.helper3(strobj)
422466

467+
# TODO: RUSTPYTHON
468+
@unittest.expectedFailure
423469
def testBytes(self):
424470
bytesobj = b"abcde"*3
425471
self.helper(bytesobj)
426472
self.helper3(bytesobj)
427473

474+
# TODO: RUSTPYTHON
475+
@unittest.expectedFailure
428476
def testList(self):
429477
for obj in self.keys:
430478
listobj = [obj, obj]
431479
self.helper(listobj)
432480
self.helper3(listobj)
433481

482+
# TODO: RUSTPYTHON
483+
@unittest.expectedFailure
434484
def testTuple(self):
435485
for obj in self.keys:
436486
tupleobj = (obj, obj)
437487
self.helper(tupleobj)
438488
self.helper3(tupleobj)
439489

490+
# TODO: RUSTPYTHON
491+
@unittest.expectedFailure
440492
def testSet(self):
441493
for obj in self.keys:
442494
setobj = {(obj, 1), (obj, 2)}
443495
self.helper(setobj)
444496
self.helper3(setobj)
445497

498+
# TODO: RUSTPYTHON
499+
@unittest.expectedFailure
446500
def testFrozenSet(self):
447501
for obj in self.keys:
448502
frozensetobj = frozenset({(obj, 1), (obj, 2)})
449503
self.helper(frozensetobj)
450504
self.helper3(frozensetobj)
451505

506+
# TODO: RUSTPYTHON
507+
@unittest.expectedFailure
452508
def testDict(self):
453509
for obj in self.keys:
454510
dictobj = {"hello": obj, "goodbye": obj, obj: "hello"}
455511
self.helper(dictobj)
456512
self.helper3(dictobj)
457513

514+
# TODO: RUSTPYTHON
515+
@unittest.expectedFailure
458516
def testModule(self):
459517
with open(__file__, "rb") as f:
460518
code = f.read()
@@ -463,6 +521,8 @@ def testModule(self):
463521
self.helper(code)
464522
self.helper3(code)
465523

524+
# TODO: RUSTPYTHON
525+
@unittest.expectedFailure
466526
def testRecursion(self):
467527
obj = 1.2345
468528
d = {"hello": obj, "goodbye": obj, obj: "hello"}
@@ -481,29 +541,41 @@ def _test(self, version):
481541
data = marshal.dumps(code, version)
482542
marshal.loads(data)
483543

544+
# TODO: RUSTPYTHON
545+
@unittest.expectedFailure
484546
def test0To3(self):
485547
self._test(0)
486548

549+
# TODO: RUSTPYTHON
550+
@unittest.expectedFailure
487551
def test1To3(self):
488552
self._test(1)
489553

554+
# TODO: RUSTPYTHON
555+
@unittest.expectedFailure
490556
def test2To3(self):
491557
self._test(2)
492558

559+
# TODO: RUSTPYTHON
560+
@unittest.expectedFailure
493561
def test3To3(self):
494562
self._test(3)
495563

496564
class InterningTestCase(unittest.TestCase, HelperMixin):
497565
strobj = "this is an interned string"
498566
strobj = sys.intern(strobj)
499567

568+
# TODO: RUSTPYTHON
569+
@unittest.expectedFailure
500570
def testIntern(self):
501571
s = marshal.loads(marshal.dumps(self.strobj))
502572
self.assertEqual(s, self.strobj)
503573
self.assertEqual(id(s), id(self.strobj))
504574
s2 = sys.intern(s)
505575
self.assertEqual(id(s2), id(s))
506576

577+
# TODO: RUSTPYTHON
578+
@unittest.expectedFailure
507579
def testNoIntern(self):
508580
s = marshal.loads(marshal.dumps(self.strobj, 2))
509581
self.assertEqual(s, self.strobj)

0 commit comments

Comments
 (0)