mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
Add builtin.PythonFinalizationError (#7966)
* Add PythonFinalizationError to builtins * Patch failing tests (unrelated) * Unmark passing test * Update `exception_hierarchy.txt` to 3.14.5
This commit is contained in:
1
Lib/test/exception_hierarchy.txt
vendored
1
Lib/test/exception_hierarchy.txt
vendored
@@ -40,6 +40,7 @@ BaseException
|
||||
├── ReferenceError
|
||||
├── RuntimeError
|
||||
│ ├── NotImplementedError
|
||||
│ ├── PythonFinalizationError
|
||||
│ └── RecursionError
|
||||
├── StopAsyncIteration
|
||||
├── StopIteration
|
||||
|
||||
4
Lib/test/test_builtin.py
vendored
4
Lib/test/test_builtin.py
vendored
@@ -2696,6 +2696,7 @@ class PtyTests(unittest.TestCase):
|
||||
else:
|
||||
yield
|
||||
|
||||
@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: got 0 lines in pipe but expected 2, child output was: quux
|
||||
def test_input_tty(self):
|
||||
# Test input() functionality when wired to a tty
|
||||
self.check_input_tty("prompt", b"quux")
|
||||
@@ -2710,17 +2711,20 @@ class PtyTests(unittest.TestCase):
|
||||
# Check stdin/stdout error handler is used when invoking PyOS_Readline()
|
||||
self.check_input_tty("prompté", b"quux\xe9", "ascii")
|
||||
|
||||
@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: got 0 lines in pipe but expected 2, child output was: quux
|
||||
def test_input_tty_null_in_prompt(self):
|
||||
self.check_input_tty("prompt\0", b"",
|
||||
expected='ValueError: input: prompt string cannot contain '
|
||||
'null characters')
|
||||
|
||||
@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: got 0 lines in pipe but expected 2, child output was: quux
|
||||
def test_input_tty_nonencodable_prompt(self):
|
||||
self.check_input_tty("prompté", b"quux", "ascii", stdout_errors='strict',
|
||||
expected="UnicodeEncodeError: 'ascii' codec can't encode "
|
||||
"character '\\xe9' in position 6: ordinal not in "
|
||||
"range(128)")
|
||||
|
||||
@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: got 0 lines in pipe but expected 2, child output was: quux
|
||||
def test_input_tty_nondecodable_input(self):
|
||||
self.check_input_tty("prompt", b"quux\xe9", "ascii", stdin_errors='strict',
|
||||
expected="UnicodeDecodeError: 'ascii' codec can't decode "
|
||||
|
||||
1
Lib/test/test_pickle.py
vendored
1
Lib/test/test_pickle.py
vendored
@@ -775,7 +775,6 @@ class CompatPickleTests(unittest.TestCase):
|
||||
module, name = mapping(module, name)
|
||||
self.assertEqual((module, name), (module3, name3))
|
||||
|
||||
@unittest.expectedFailure # TODO: RUSTPYTHON
|
||||
def test_exceptions(self):
|
||||
self.assertEqual(mapping('exceptions', 'StandardError'),
|
||||
('builtins', 'Exception'))
|
||||
|
||||
@@ -1474,6 +1474,7 @@ pub fn init_module(vm: &VirtualMachine, module: &Py<PyModule>) {
|
||||
"TimeoutError" => ctx.exceptions.timeout_error.to_owned(),
|
||||
"ReferenceError" => ctx.exceptions.reference_error.to_owned(),
|
||||
"RuntimeError" => ctx.exceptions.runtime_error.to_owned(),
|
||||
"PythonFinalizationError" => ctx.exceptions.python_finalization_error.to_owned(),
|
||||
"NotImplementedError" => ctx.exceptions.not_implemented_error.to_owned(),
|
||||
"RecursionError" => ctx.exceptions.recursion_error.to_owned(),
|
||||
"SyntaxError" => ctx.exceptions.syntax_error.to_owned(),
|
||||
|
||||
Reference in New Issue
Block a user