mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Update test_type_comments.py to 3.14.5 (#7858)
This commit is contained in:
1 parent
e0689bad7c
commit
f5357692e8
1 file changed
+11
Vendored
+11
@@ -1,6 +1,7 @@
|
||||
import ast
|
||||
import sys
|
||||
import unittest
|
||||
from test.support import import_helper
|
||||
|
||||
|
||||
funcdef = """\
|
||||
@@ -405,6 +406,16 @@ class TypeCommentTests(unittest.TestCase):
|
||||
check_both_ways("pass # type: ignorewhatever\n")
|
||||
check_both_ways("pass # type: ignoreé\n")
|
||||
|
||||
def test_non_utf8_type_comment_with_ignore_cookie(self):
|
||||
_testcapi = import_helper.import_module('_testcapi')
|
||||
flags = 0x0800 | 0x1000 # PyCF_IGNORE_COOKIE | PyCF_TYPE_COMMENTS
|
||||
with self.assertRaises(UnicodeDecodeError):
|
||||
_testcapi.Py_CompileStringExFlags(
|
||||
b"a=1 # type: \x80", "<test>", 256, flags)
|
||||
with self.assertRaises(UnicodeDecodeError):
|
||||
_testcapi.Py_CompileStringExFlags(
|
||||
b"def a(f=8, #type: \x80\n\x80", "<test>", 256, flags)
|
||||
|
||||
@unittest.expectedFailure # TODO: RUSTPYTHON; ValueError: mode must be "exec", "eval", "ipython", or "single"
|
||||
def test_func_type_input(self):
|
||||
|
||||
|
||||
Reference in new issue
Block a user