Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Mark CPython specific tests as such.
  • Loading branch information
serhiy-storchaka committed Dec 28, 2025
commit cd2e330a05fe8ba7d6dba218f1a69b48c117a45b
11 changes: 6 additions & 5 deletions Lib/test/test_base64.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import sys
import os
from array import array
from test.support import cpython_only
from test.support import cpython_only, check_impl_detail
from test.support import os_helper
from test.support import script_helper
from test.support.import_helper import ensure_lazy_imports
Expand Down Expand Up @@ -181,10 +181,11 @@ def test_b64encode(self):
b'd\n3\nd\n3\nL\nn\nB\n5\nd\nG\nh\nv\nb\ni\n5\nv\nc\nm\nc\n=')
eq(base64.b64encode(b"www.python.org", wrapcol=sys.maxsize),
b'd3d3LnB5dGhvbi5vcmc=')
eq(base64.b64encode(b"www.python.org", wrapcol=sys.maxsize*2),
b'd3d3LnB5dGhvbi5vcmc=')
with self.assertRaises(OverflowError):
base64.b64encode(b"www.python.org", wrapcol=2**1000)
if check_impl_detail():
eq(base64.b64encode(b"www.python.org", wrapcol=sys.maxsize*2),
b'd3d3LnB5dGhvbi5vcmc=')
with self.assertRaises(OverflowError):
base64.b64encode(b"www.python.org", wrapcol=2**1000)
with self.assertRaises(ValueError):
base64.b64encode(b"www.python.org", wrapcol=-8)
with self.assertRaises(TypeError):
Expand Down
11 changes: 6 additions & 5 deletions Lib/test/test_binascii.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import array
import re
import sys
from test.support import bigmemtest, _1G, _4G
from test.support import bigmemtest, _1G, _4G, check_impl_detail
from test.support.hypothesis_helper import hypothesis


Expand Down Expand Up @@ -501,10 +501,11 @@ def test_b2a_base64_wrapcol(self):
b'd\n3\nd\n3\nL\nn\nB\n5\nd\nG\nh\nv\nb\ni\n5\nv\nc\nm\nc\n=\n')
self.assertEqual(binascii.b2a_base64(b, wrapcol=sys.maxsize),
b'd3d3LnB5dGhvbi5vcmc=\n')
self.assertEqual(binascii.b2a_base64(b, wrapcol=sys.maxsize*2),
b'd3d3LnB5dGhvbi5vcmc=\n')
with self.assertRaises(OverflowError):
binascii.b2a_base64(b, wrapcol=2**1000)
if check_impl_detail():
self.assertEqual(binascii.b2a_base64(b, wrapcol=sys.maxsize*2),
b'd3d3LnB5dGhvbi5vcmc=\n')
with self.assertRaises(OverflowError):
binascii.b2a_base64(b, wrapcol=2**1000)
with self.assertRaises(ValueError):
binascii.b2a_base64(b, wrapcol=-8)
with self.assertRaises(TypeError):
Expand Down