mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Align required canonical test expectations with Python 3.15
Take only demonstrated contract changes from CPython v3.15.0, d220409a13b77de7a6c30abe16ea90db01528edc: removed module __cached__, Struct format exception classes, and decimal-format diagnostic. Preserve unrelated tests and expectations. Assisted-by: OpenAI Codex:model identifier unavailable
This commit is contained in:
1 parent
459395bc21
commit
93918795b8
3 files changed
+4
-6
No files matched your search
Vendored
-3
@@ -44,7 +44,6 @@ from importlib.machinery import BuiltinImporter
|
||||
_loader = __loader__ if __loader__ is BuiltinImporter else type(__loader__)
|
||||
print('__loader__==%a' % _loader)
|
||||
print('__file__==%a' % __file__)
|
||||
print('__cached__==%a' % __cached__)
|
||||
print('__package__==%r' % __package__)
|
||||
# Check PEP 451 details
|
||||
import os.path
|
||||
@@ -58,8 +57,6 @@ if __package__ is not None:
|
||||
assertEqual(__spec__.parent, __package__)
|
||||
assertIdentical(__spec__.submodule_search_locations, None)
|
||||
assertEqual(__spec__.origin, __file__)
|
||||
if __spec__.cached is not None:
|
||||
assertEqual(__spec__.cached, __cached__)
|
||||
# Check the sys module
|
||||
import sys
|
||||
assertIdentical(globals(), sys.modules[__name__].__dict__)
|
||||
|
||||
Vendored
+2
-1
@@ -743,7 +743,8 @@ class TestTranforms(BytecodeTestCase):
|
||||
eval("'%s%z' % (x,)", {'x': 1234})
|
||||
with self.assertRaisesRegex(ValueError, 'unsupported format character'):
|
||||
eval("'%s%z' % (x, 5)", {'x': 1234})
|
||||
with self.assertRaisesRegex(TypeError, 'a real number is required, not str'):
|
||||
with self.assertRaisesRegex(TypeError,
|
||||
'format argument 1: %d requires a real number, not str'):
|
||||
eval("'%d' % (x,)", {'x': '1234'})
|
||||
with self.assertRaisesRegex(TypeError, 'an integer is required, not float'):
|
||||
eval("'%x' % (x,)", {'x': 1234.56})
|
||||
|
||||
Vendored
+2
-2
@@ -622,7 +622,7 @@ class StructTest(ComplexesAreIdenticalMixin, unittest.TestCase):
|
||||
self.assertEqual(s.pack(1, 2), packed)
|
||||
self.assertEqual(s.unpack(packed), (1, 2))
|
||||
|
||||
with self.assertRaises(UnicodeEncodeError):
|
||||
with self.assertRaises(ValueError):
|
||||
s.__init__('\udc00')
|
||||
self.assertEqual(s.format, '>hh')
|
||||
self.assertEqual(s.pack(1, 2), packed)
|
||||
@@ -882,7 +882,7 @@ class StructTest(ComplexesAreIdenticalMixin, unittest.TestCase):
|
||||
self.assertRaises(RuntimeError, S.pack_into, spam, 1)
|
||||
self.assertRaises(RuntimeError, S.unpack, spam)
|
||||
self.assertRaises(RuntimeError, S.unpack_from, spam)
|
||||
self.assertRaises(RuntimeError, getattr, S, 'format')
|
||||
self.assertRaises(AttributeError, getattr, S, 'format')
|
||||
self.assertRaises(RuntimeError, S.__sizeof__)
|
||||
self.assertRaises(RuntimeError, repr, S)
|
||||
self.assertEqual(S.size, -1)
|
||||
|
||||
Reference in new issue
Block a user