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

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

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
corrected mislabeled tests
  • Loading branch information
Koimeijisan committed Jul 29, 2024
commit 208b26dc0da00fd378a8b71d4df9521445c53456
38 changes: 23 additions & 15 deletions Lib/test/test_codecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3225,56 +3225,64 @@ def check_note(self, obj_to_raise, msg, exc_type=RuntimeError):
with self.assertNoted("decoding", exc_type, msg):
codecs.decode(b"bytes input", self.codec_name)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_raise_by_type(self):
self.check_note(RuntimeError, "")

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_raise_by_value(self):
msg = "This should be noted"
self.check_note(RuntimeError(msg), msg)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_raise_grandchild_subclass_exact_size(self):
msg = "This should be noted"
class MyRuntimeError(RuntimeError):
__slots__ = ()
self.check_note(MyRuntimeError(msg), msg, MyRuntimeError)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_raise_subclass_with_weakref_support(self):
msg = "This should be noted"
class MyRuntimeError(RuntimeError):
pass
self.check_note(MyRuntimeError(msg), msg, MyRuntimeE 8000 rror)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_init_override(self):
class CustomInit(RuntimeError):
def __init__(self):
pass
self.check_note(CustomInit, "")

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_new_override(self):
class CustomNew(RuntimeError):
def __new__(cls):
return super().__new__(cls)
self.check_note(CustomNew, "")


@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_instance_attribute(self):
msg = "This should be noted"
exc = RuntimeError(msg)
exc.attr = 1
self.check_note(exc, "^{}$".format(msg))

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_non_str_arg(self):
self.check_note(RuntimeError(1), "1")

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_multiple_args(self):
msg_re = r"^\('a', 'b', 'c'\)$"
self.check_note(RuntimeError('a', 'b', 'c'), msg_re)
Expand All @@ -3293,7 +3301,7 @@ def test_codec_lookup_failure(self):
codecs.decode(b"bytes input", self.codec_name)


@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
@unittest.expectedFailure
def test_unflagged_non_text_codec_handling(self):
# The stdlib non-text codecs are now marked so they're
# pre-emptively skipped by the text model related methods
Expand Down
0