Skip to content

Commit cd2e330

Browse files
Mark CPython specific tests as such.
1 parent 5062ae5 commit cd2e330

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

Lib/test/test_base64.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import sys
66
import os
77
from array import array
8-
from test.support import cpython_only
8+
from test.support import cpython_only, check_impl_detail
99
from test.support import os_helper
1010
from test.support import script_helper
1111
from test.support.import_helper import ensure_lazy_imports
@@ -181,10 +181,11 @@ def test_b64encode(self):
181181
b'd\n3\nd\n3\nL\nn\nB\n5\nd\nG\nh\nv\nb\ni\n5\nv\nc\nm\nc\n=')
182182
eq(base64.b64encode(b"www.python.org", wrapcol=sys.maxsize),
183183
b'd3d3LnB5dGhvbi5vcmc=')
184-
eq(base64.b64encode(b"www.python.org", wrapcol=sys.maxsize*2),
185-
b'd3d3LnB5dGhvbi5vcmc=')
186-
with self.assertRaises(OverflowError):
187-
base64.b64encode(b"www.python.org", wrapcol=2**1000)
184+
if check_impl_detail():
185+
eq(base64.b64encode(b"www.python.org", wrapcol=sys.maxsize*2),
186+
b'd3d3LnB5dGhvbi5vcmc=')
187+
with self.assertRaises(OverflowError):
188+
base64.b64encode(b"www.python.org", wrapcol=2**1000)
188189
with self.assertRaises(ValueError):
189190
base64.b64encode(b"www.python.org", wrapcol=-8)
190191
with self.assertRaises(TypeError):

Lib/test/test_binascii.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import array
66
import re
77
import sys
8-
from test.support import bigmemtest, _1G, _4G
8+
from test.support import bigmemtest, _1G, _4G, check_impl_detail
99
from test.support.hypothesis_helper import hypothesis
1010

1111

@@ -501,10 +501,11 @@ def test_b2a_base64_wrapcol(self):
501501
b'd\n3\nd\n3\nL\nn\nB\n5\nd\nG\nh\nv\nb\ni\n5\nv\nc\nm\nc\n=\n')
502502
self.assertEqual(binascii.b2a_base64(b, wrapcol=sys.maxsize),
503503
b'd3d3LnB5dGhvbi5vcmc=\n')
504-
self.assertEqual(binascii.b2a_base64(b, wrapcol=sys.maxsize*2),
505-
b'd3d3LnB5dGhvbi5vcmc=\n')
506-
with self.assertRaises(OverflowError):
507-
binascii.b2a_base64(b, wrapcol=2**1000)
504+
if check_impl_detail():
505+
self.assertEqual(binascii.b2a_base64(b, wrapcol=sys.maxsize*2),
506+
b'd3d3LnB5dGhvbi5vcmc=\n')
507+
with self.assertRaises(OverflowError):
508+
binascii.b2a_base64(b, wrapcol=2**1000)
508509
with self.assertRaises(ValueError):
509510
binascii.b2a_base64(b, wrapcol=-8)
510511
with self.assertRaises(TypeError):

0 commit comments

Comments
 (0)