8000 Update codecs and test_codecs from cpython v3.12.4 by Andrewb12505 · Pull Request #5372 · RustPython/RustPython · GitHub
[go: up one dir, main page]

Skip to content

Update codecs and test_codecs from cpython v3.12.4 #5372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

8000
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Unmarked passing tests
  • Loading branch information
Andrewb12505 committed Jul 28, 2024
commit 47a65e35bcaba0c891aebf549a925bdfda945154
24 changes: 8 additions & 16 deletions Lib/test/test_codecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1960,17 +1960,15 @@ def test_readlines(self):
f = self.reader(self.stream)
self.assertEqual(f.readlines(), ['\ud55c\n', '\uae00'])

# TODO: RUSTPYTHON
@unittest.expectedFailure

def test_copy(self):
f = self.reader(Queue(b'\xed\x95\x9c\n\xea\xb8\x80'))
with self.assertRaisesRegex(TypeError, 'StreamReader'):
copy.copy(f)
with self.assertRaisesRegex(TypeError, 'StreamReader'):
copy.deepcopy(f)

# TODO: RUSTPYTHON
@unittest.expectedFailure

def test_pickle(self):
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
with self.subTest(protocol=proto):
Expand All @@ -1984,16 +1982,14 @@ class StreamWriterTest(unittest.TestCase):
def setUp(self):
self.writer = codecs.getwriter('utf-8')

# TODO: RUSTPYTHON
@unittest.expectedFailure

def test_copy(self):
f = self.writer(Queue(b''))
with self.assertRaisesRegex(TypeError, 'StreamWriter'):
copy.copy(f)
with self.assertRaisesRegex(TypeError, 'StreamWriter'):
copy.deepcopy(f)
# TODO: RUSTPYTHON
@unittest.expectedFailure

def test_pickle(self):
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
with self.subTest(protocol=proto):
Expand All @@ -2008,16 +2004,14 @@ def setUp(self):
self.reader = codecs.getreader('latin1')
self.writer = codecs.getwriter('utf-8')

# TODO: RUSTPYTHON
@unittest.expectedFailure

def test_copy(self):
f = codecs.StreamReaderWriter(Queue(b''), self.reader, self.writer)
with self.assertRaisesRegex(TypeError, 'StreamReaderWriter'):
copy.copy(f)
with self.assertRaisesRegex(TypeError, 'StreamReaderWriter'):
copy.deepcopy(f)
# TODO: RUSTPYTHON
@unittest.expectedFailure

def test_pickle(self):
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
with self.subTest(protocol=proto):
Expand Down Expand Up @@ -3709,8 +3703,7 @@ def test_seeking_write(self):
self.assertEqual(sr.readline(), b'abc\n')
self.assertEqual(sr.readline(), b'789\n')

# TODO: RUSTPYTHON
@unittest.expectedFailure

def test_copy(self):
bio = io.BytesIO()
codec = codecs.lookup('ascii')
Expand All @@ -3721,8 +3714,7 @@ def test_copy(self):
copy.copy(sr)
with self.assertRaisesRegex(TypeError, 'StreamRecoder'):
copy.deepcopy(sr)
#TODO: RUSTPYTHON
@unittest.expectedFailure

def test_pickle(self):
q = Queue(b'')
codec = codecs.lookup('ascii')
Expand Down
0