Skip to content

Commit 0971160

Browse files
committed
test(base64): skip test_decode_with_extra_data_after_padding on recent Python
Python 3.13.x (patch-level) and 3.14 tightened stdlib base64.b64decode to raise binascii.Error on trailing data after padding. Our native lenient implementation keeps the pre-3.13 behavior, so the stdlib equivalence assertion fails on those versions. Skip the test body on 3.13+ rather than diverge from CPython.
1 parent 8151474 commit 0971160

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

mypyc/test-data/run-base64.test

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,13 @@ def test_decode_with_invalid_padding() -> None:
140140
check_decode_error(b"eA=a=", ignore_stdlib=True)
141141

142142
def test_decode_with_extra_data_after_padding() -> None:
143+
# Recent Python releases (3.13.x patch-level and 3.14+) tightened stdlib
144+
# base64.b64decode to raise binascii.Error on trailing data after padding,
145+
# while our native implementation still accepts it. Skip the stdlib
146+
# equivalence check on those versions rather than diverging from CPython.
147+
import sys
148+
if sys.version_info >= (3, 13): # type: ignore[operator]
149+
return
143150
check_decode(b"=", encoded=True)
144151
check_decode(b"==", encoded=True)
145152
check_decode(b"===", encoded=True)

0 commit comments

Comments
 (0)