Skip to content

Commit d379c5f

Browse files
committed
Ignore bytes.__mod__ tests on Python < 3.5
1 parent 1533854 commit d379c5f

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/future/utils/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656

5757

5858
PY3 = sys.version_info[0] == 3
59+
PY35 = sys.version_info[0:2] >= (3, 5)
5960
PY2 = sys.version_info[0] == 2
6061
PY26 = sys.version_info[0:2] == (2, 6)
6162
PY27 = sys.version_info[0:2] == (2, 7)

tests/test_future/test_bytes.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,8 @@ def test_maketrans(self):
552552
self.assertRaises(ValueError, bytes.maketrans, b'abc', b'xyzq')
553553
self.assertRaises(TypeError, bytes.maketrans, 'abc', 'def')
554554

555+
@unittest.skipUnless(utils.PY35 or utils.PY2,
556+
'test requires Python 2 or 3.5+')
555557
def test_mod_more(self):
556558
self.assertEqual(b'%s' % b'aaa', b'aaa')
557559
self.assertEqual(bytes(b'%s') % b'aaa', b'aaa')
@@ -564,6 +566,8 @@ def test_mod_more(self):
564566
self.assertEqual(bytes(b'%(x)s') % {'x': b'aaa'}, b'aaa')
565567
self.assertEqual(bytes(b'%(x)s') % {'x': bytes(b'aaa')}, b'aaa')
566568

569+
@unittest.skipUnless(utils.PY35 or utils.PY2,
570+
'test requires Python 2 or 3.5+')
567571
def test_mod(self):
568572
"""
569573
From Py3.5 test suite (post-PEP 461).

0 commit comments

Comments
 (0)