Skip to content

Commit 4e21df2

Browse files
fanninpmyouknowone
authored andcommitted
Clean up skips in test_io
1 parent 122ddeb commit 4e21df2

1 file changed

Lines changed: 31 additions & 24 deletions

File tree

Lib/test/test_io.py

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,6 @@ def bad_flush():
800800
self.assertFalse(closed[0]) # flush() called before file closed
801801
f.flush = lambda: None # break reference loop
802802

803-
@unittest.skip("TODO: RUSTPYTHON, specifics of operation order in close()")
804803
def test_flush_error_on_close(self):
805804
# raw file
806805
# Issue #5700: io.FileIO calls flush() after file closed
@@ -1039,9 +1038,6 @@ def test_destructor(self):
10391038
super().test_destructor(self)
10401039

10411040
class PyIOTest(IOTest):
1042-
def test_optional_abilities(self):
1043-
super().test_optional_abilities()
1044-
10451041
pass
10461042

10471043

@@ -1155,7 +1151,6 @@ def test_recursive_repr(self):
11551151
except RuntimeError:
11561152
pass
11571153

1158-
@unittest.skip("TODO: RUSTPYTHON, specifics of operation order in close()")
11591154
def test_flush_error_on_close(self):
11601155
# Test that buffered file is closed despite failed flush
11611156
# and that flush() is called before file closed.
@@ -1602,6 +1597,11 @@ def test_args_error(self):
16021597
with self.assertRaisesRegex(TypeError, "BufferedReader"):
16031598
self.tp(io.BytesIO(), 1024, 1024, 1024)
16041599

1600+
# TODO: RUSTPYTHON
1601+
@unittest.expectedFailure
1602+
def test_flush_error_on_close(self):
1603+
super().test_flush_error_on_close()
1604+
16051605

16061606
class PyBufferedReaderTest(BufferedReaderTest):
16071607
tp = pyio.BufferedReader
@@ -1955,6 +1955,11 @@ def test_args_error(self):
19551955
with self.assertRaisesRegex(TypeError, "BufferedWriter"):
19561956
self.tp(io.BytesIO(), 1024, 1024, 1024)
19571957

1958+
# TODO: RUSTPYTHON
1959+
@unittest.expectedFailure
1960+
def test_flush_error_on_close(self):
1961+
super().test_flush_error_on_close()
1962+
19581963

19591964
class PyBufferedWriterTest(BufferedWriterTest):
19601965
tp = pyio.BufferedWriter
@@ -2434,8 +2439,12 @@ def test_args_error(self):
24342439
with self.assertRaisesRegex(TypeError, "BufferedRandom"):
24352440
self.tp(io.BytesIO(), 1024, 1024, 1024)
24362441

2442+
# TODO: RUSTPYTHON
2443+
@unittest.expectedFailure
2444+
def test_flush_error_on_close(self):
2445+
super().test_flush_error_on_close()
2446+
24372447

2438-
@unittest.skip("TODO: RUSTPYTHON, BufferError: Existing exports of data: object cannot be re-sized")
24392448
class PyBufferedRandomTest(BufferedRandomTest):
24402449
tp = pyio.BufferedRandom
24412450

@@ -2628,7 +2637,6 @@ def test_non_text_encoding_codecs_are_rejected(self):
26282637
with self.assertRaisesRegex(LookupError, "is not a text encoding"):
26292638
self.TextIOWrapper(b, encoding="hex")
26302639

2631-
@unittest.skip('TODO: RUSTPYTHON')
26322640
def test_detach(self):
26332641
r = self.BytesIO()
26342642
b = self.BufferedWriter(r)
@@ -2690,7 +2698,6 @@ def test_line_buffering(self):
26902698
t.write("A\rB")
26912699
self.assertEqual(r.getvalue(), b"XY\nZA\rB")
26922700

2693-
@unittest.skip('TODO: RUSTPYTHON')
26942701
def test_reconfigure_line_buffering(self):
26952702
r = self.BytesIO()
26962703
b = self.BufferedWriter(r, 1000)
@@ -3755,11 +3762,21 @@ class CTextIOWrapperTest(TextIOWrapperTest):
37553762
def test_constructor(self):
37563763
super().test_constructor()
37573764

3765+
# TODO: RUSTPYTHON
3766+
@unittest.expectedFailure
3767+
def test_detach(self):
3768+
super().test_detach()
3769+
37583770
# TODO: RUSTPYTHON
37593771
@unittest.expectedFailure
37603772
def test_reconfigure_encoding_read(self):
37613773
super().test_reconfigure_encoding_read()
37623774

3775+
# TODO: RUSTPYTHON
3776+
@unittest.expectedFailure
3777+
def test_reconfigure_line_buffering(self):
3778+
super().test_reconfigure_line_buffering()
3779+
37633780
# TODO: RUSTPYTHON
37643781
@unittest.expectedFailure
37653782
def test_basic_io(self):
@@ -3920,20 +3937,7 @@ class PyTextIOWrapperTest(TextIOWrapperTest):
39203937
def test_newlines(self):
39213938
super().test_newlines()
39223939

3923-
def test_line_buffering(self):
3924-
super().test_line_buffering()
3925-
3926-
def test_seeking_too(self):
3927-
super().test_seeking_too()
3928-
3929-
def test_bufio_write_through(self):
3930-
super().test_bufio_write_through()
3931-
3932-
def test_seeking(self):
3933-
super().test_seeking()
3934-
39353940

3936-
@unittest.skip("TODO: RUSTPYTHON, incremental decoder")
39373941
class IncrementalNewlineDecoderTest(unittest.TestCase):
39383942

39393943
def check_newline_decoding_utf8(self, decoder):
@@ -4011,6 +4015,8 @@ def _decode_bytewise(s):
40114015
self.assertEqual(decoder.decode(input), "abc")
40124016
self.assertEqual(decoder.newlines, None)
40134017

4018+
# TODO: RUSTPYTHON
4019+
@unittest.expectedFailure
40144020
def test_newline_decoder(self):
40154021
encodings = (
40164022
# None meaning the IncrementalNewlineDecoder takes unicode input
@@ -4028,6 +4034,8 @@ def test_newline_decoder(self):
40284034
self.check_newline_decoding_utf8(decoder)
40294035
self.assertRaises(TypeError, decoder.setstate, 42)
40304036

4037+
# TODO: RUSTPYTHON
4038+
@unittest.expectedFailure
40314039
def test_newline_bytes(self):
40324040
# Issue 5433: Excessive optimization in IncrementalNewlineDecoder
40334041
def _check(dec):
@@ -4041,6 +4049,8 @@ def _check(dec):
40414049
dec = self.IncrementalNewlineDecoder(None, translate=True)
40424050
_check(dec)
40434051

4052+
# TODO: RUSTPYTHON
4053+
@unittest.expectedFailure
40444054
def test_translate(self):
40454055
# issue 35062
40464056
for translate in (-2, -1, 1, 2):
@@ -4106,7 +4116,6 @@ def test_attributes(self):
41064116
f.close()
41074117
g.close()
41084118

4109-
@unittest.skip("TODO: RUSTPYTHON, check if fd is seekable fileio")
41104119
def test_open_pipe_with_append(self):
41114120
# bpo-27805: Ignore ESPIPE from lseek() in open().
41124121
r, w = os.pipe()
@@ -4415,7 +4424,6 @@ class PyMiscIOTest(MiscIOTest):
44154424
io = pyio
44164425

44174426

4418-
44194427
@unittest.skipIf(os.name == 'nt', 'POSIX signals required for this test.')
44204428
class SignalsTest(unittest.TestCase):
44214429

@@ -4486,7 +4494,6 @@ def test_interrupted_write_unbuffered(self):
44864494
def test_interrupted_write_buffered(self):
44874495
self.check_interrupted_write(b"xy", b"xy", mode="wb")
44884496

4489-
@unittest.skip("TODO: RUSTPYTHON, hangs?")
44904497
def test_interrupted_write_text(self):
44914498
self.check_interrupted_write("xy", b"xy", mode="w", encoding="ascii")
44924499

0 commit comments

Comments
 (0)