Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b0ec8ee
Updated bdb.py + test_bdb.py
terryluan12 Dec 30, 2025
91d4447
Deleted _pycodecs.py
terryluan12 Dec 30, 2025
ac9bd54
Updated code.py library
terryluan12 Dec 30, 2025
d5f6198
Updated the _pydatetime.py lib
terryluan12 Dec 30, 2025
f585018
Removed distutils package
terryluan12 Dec 30, 2025
da4a841
Updated doctest package
terryluan12 Dec 30, 2025
d7405c9
* Updated datetimetester.py
terryluan12 Dec 30, 2025
e82917e
Updated enum and test_enum.py
terryluan12 Dec 30, 2025
6e59ca5
Updated filecmp + test_filecmp
terryluan12 Dec 30, 2025
aae2dcf
Updated fractions + test_fractions
terryluan12 Dec 30, 2025
fd34286
Updated ftplib + test_ftplib
terryluan12 Dec 30, 2025
77db70c
Updated hmac + test_hmac
terryluan12 Dec 30, 2025
7c13c61
* Updated mailbox + added test_mailbox.py
terryluan12 Dec 30, 2025
3752174
Updated nturl2path.py
terryluan12 Dec 30, 2025
cd5865e
Added pathlib + test_pathlib packages
terryluan12 Dec 30, 2025
0e3365a
Updated pkgutil.py & test_pkgutil.py
terryluan12 Dec 30, 2025
d313adc
Updated platform.py + test_platform.py
terryluan12 Dec 30, 2025
6da715b
Updated plistlib + test_plistlib
terryluan12 Dec 30, 2025
2ee4e37
Merge branch 'add_tests' into update_simple_packages_2
terryluan12 Dec 30, 2025
28493a7
Updated enum and plistlib tests using the script
terryluan12 Dec 30, 2025
312f7d9
Updated pkgutil test with the script
terryluan12 Dec 30, 2025
39f990e
Ran/updated ftplib +test_hmac + pathlib tests with the script
terryluan12 Dec 30, 2025
1cd4ad6
Added comment to pathlib
terryluan12 Dec 30, 2025
88857d9
Clarified the comments at the top of test_pathlib
terryluan12 Dec 30, 2025
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
Updated enum and plistlib tests using the script
  • Loading branch information
terryluan12 committed Dec 30, 2025
commit 28493a7d9c0fd5daafb318f2e2d269d9ba8a64f2
23 changes: 8 additions & 15 deletions Lib/test/test_enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -1769,8 +1769,7 @@ class ThreePart(Enum):
self.assertIs(ThreePart((3, 3.0, 'three')), ThreePart.THREE)
self.assertIs(ThreePart(3, 3.0, 'three'), ThreePart.THREE)

# TODO: RUSTPYTHON, AssertionError: <test.test_enum.IntStooges object at 0x55c70c38a240> is not <IntStooges.MOE: 3>
@unittest.expectedFailure
@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: <test.test_enum.IntStooges object at 0x55c70c38a240> is not <IntStooges.MOE: 3>
@reraise_if_not_enum(IntStooges)
def test_intenum_from_bytes(self):
self.assertIs(IntStooges.from_bytes(b'\x00\x03', 'big'), IntStooges.MOE)
Expand Down Expand Up @@ -2131,8 +2130,7 @@ class NEI(NamedInt, Enum):
test_pickle_dump_load(self.assertIs, NEI.y)
test_pickle_dump_load(self.assertIs, NEI)

# TODO: RUSTPYTHON, fails on pickle
@unittest.expectedFailure
@unittest.expectedFailure # TODO: RUSTPYTHON; fails on pickle
def test_subclasses_with_getnewargs_ex(self):
class NamedInt(int):
__qualname__ = 'NamedInt' # needed for pickle protocol 4
Expand Down Expand Up @@ -3066,8 +3064,7 @@ class ThirdFailedStrEnum(StrEnum):
one = '1'
two = b'2', 'ascii', 9

# TODO: RUSTPYTHON, fails on encoding testing : TypeError: Expected type 'str' but 'builtin_function_or_method' found
@unittest.expectedFailure
@unittest.expectedFailure # TODO: RUSTPYTHON; fails on encoding testing : TypeError: Expected type 'str' but 'builtin_function_or_method' found
def test_custom_strenum(self):
class CustomStrEnum(str, Enum):
pass
Expand Down Expand Up @@ -4007,7 +4004,7 @@ class Color(StrMixin, AllMixin, Flag):
self.assertEqual(Color.ALL.value, 7)
self.assertEqual(str(Color.BLUE), 'blue')

@unittest.skip("TODO: RUSTPYTHON; flaky test")
@unittest.skip('TODO: RUSTPYTHON; flaky test')
@threading_helper.reap_threads
@threading_helper.requires_working_threading()
def test_unique_composite(self):
Expand Down Expand Up @@ -4169,9 +4166,7 @@ def test_global_enum_str(self):
self.assertEqual(str(NoName.ONE & NoName.TWO), 'NoName(0)')
self.assertEqual(str(NoName(0)), 'NoName(0)')


# TODO: RUSTPYTHON, format(NewPerm.R) does not use __str__
@unittest.expectedFailure
@unittest.expectedFailure # TODO: RUSTPYTHON; format(NewPerm.R) does not use __str__
def test_format(self):
Perm = self.Perm
self.assertEqual(format(Perm.R, ''), '4')
Expand Down Expand Up @@ -4534,7 +4529,7 @@ class Color(StrMixin, AllMixin, IntFlag):
self.assertEqual(Color.ALL.value, 7)
self.assertEqual(str(Color.BLUE), 'blue')

@unittest.skip("TODO: RUSTPYTHON; flaky test")
@unittest.skip('TODO: RUSTPYTHON; flaky test')
@threading_helper.reap_threads
@threading_helper.requires_working_threading()
def test_unique_composite(self):
Expand Down Expand Up @@ -5083,8 +5078,7 @@ class Color(Enum):
MAGENTA = 2
YELLOW = 3

# TODO: RUSTPYTHON
@unittest.expectedFailure
@unittest.expectedFailure # TODO: RUSTPYTHON
def test_pydoc(self):
# indirectly test __objclass__
if StrEnum.__doc__ is None:
Expand Down Expand Up @@ -5217,8 +5211,7 @@ def test_inspect_signatures(self):
]),
)

# TODO: RUSTPYTHON, len is often/always > 256
@unittest.expectedFailure
@unittest.expectedFailure # TODO: RUSTPYTHON; len is often/always > 256
def test_test_simple_enum(self):
@_simple_enum(Enum)
class SimpleColor:
Expand Down
21 changes: 8 additions & 13 deletions Lib/test/test_plistlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,8 +752,7 @@ def test_non_bmp_characters(self):
data = plistlib.dumps(pl, fmt=fmt)
self.assertEqual(plistlib.loads(data), pl)

# TODO: RUSTPYTHON
@unittest.expectedFailure
@unittest.expectedFailure # TODO: RUSTPYTHON
def test_lone_surrogates(self):
for fmt in ALL_FORMATS:
with self.subTest(fmt=fmt):
Expand All @@ -772,17 +771,15 @@ def test_nondictroot(self):
self.assertEqual(test1, result1)
self.assertEqual(test2, result2)

# TODO: RUSTPYTHON
@unittest.expectedFailure
@unittest.expectedFailure # TODO: RUSTPYTHON
def test_invalidarray(self):
for i in ["<key>key inside an array</key>",
"<key>key inside an array2</key><real>3</real>",
"<true/><key>key inside an array3</key>"]:
self.assertRaises(ValueError, plistlib.loads,
("<plist><array>%s</array></plist>"%i).encode())

# TODO: RUSTPYTHON
@unittest.expectedFailure
@unittest.expectedFailure # TODO: RUSTPYTHON
def test_invaliddict(self):
for i in ["<key><true/>k</key><string>compound key</string>",
"<key>single key</key>",
Expand All @@ -794,14 +791,12 @@ def test_invaliddict(self):
self.assertRaises(ValueError, plistlib.loads,
("<plist><array><dict>%s</dict></array></plist>"%i).encode())

# TODO: RUSTPYTHON
@unittest.expectedFailure
@unittest.expectedFailure # TODO: RUSTPYTHON
def test_invalidinteger(self):
self.assertRaises(ValueError, plistlib.loads,
b"<plist><integer>not integer</integer></plist>")

# TODO: RUSTPYTHON
@unittest.expectedFailure
@unittest.expectedFailure # TODO: RUSTPYTHON
def test_invalidreal(self):
self.assertRaises(ValueError, plistlib.loads,
b"<plist><integer>not real</integer></plist>")
Expand Down Expand Up @@ -858,8 +853,7 @@ def test_modified_uid_huge(self):
with self.assertRaises(OverflowError):
plistlib.dumps(huge_uid, fmt=plistlib.FMT_BINARY)

# TODO: RUSTPYTHON
@unittest.expectedFailure
@unittest.expectedFailure # TODO: RUSTPYTHON
def test_xml_plist_with_entity_decl(self):
with self.assertRaisesRegex(plistlib.InvalidFileException,
"XML entity declarations are not supported"):
Expand Down Expand Up @@ -1085,7 +1079,8 @@ def test_dump_aware_datetime_without_aware_datetime_option(self):
plistlib.dumps(dt, fmt=plistlib.FMT_BINARY, aware_datetime=False)

# TODO: RUSTPYTHON
# AssertionError: "can't subtract offset-naive and offset-aware datetimes" does not match "cannot mix naive and timezone-aware time"
# The error message is different
# In CPython, there is a separate .c file for datetime
@unittest.expectedFailure
def test_dump_utc_aware_datetime_without_aware_datetime_option(self):
dt = datetime.datetime(2345, 6, 7, 8, tzinfo=datetime.UTC)
Expand Down