Skip to content

Commit d286e2a

Browse files
authored
Merge pull request #394 from jmadler/py3fix
Fix tests on Py3
2 parents e979fa3 + b9212af commit d286e2a

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

src/future/utils/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@
5656

5757

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

tests/test_future/test_bytes.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ class MyDict(UserDict.UserDict):
566566

567567
self.assertEqual(bytes(b'%(foo)s') % d, b'bar')
568568

569-
@unittest.skipUnless(utils.PY35 or utils.PY2,
569+
@unittest.skipUnless(utils.PY35_PLUS or utils.PY2,
570570
'test requires Python 2 or 3.5+')
571571
def test_mod_more(self):
572572
self.assertEqual(b'%s' % b'aaa', b'aaa')
@@ -577,10 +577,10 @@ def test_mod_more(self):
577577
self.assertEqual(bytes(b'%s') % (b'aaa',), b'aaa')
578578
self.assertEqual(bytes(b'%s') % (bytes(b'aaa'),), b'aaa')
579579

580-
self.assertEqual(bytes(b'%(x)s') % {'x': b'aaa'}, b'aaa')
581-
self.assertEqual(bytes(b'%(x)s') % {'x': bytes(b'aaa')}, b'aaa')
580+
self.assertEqual(bytes(b'%(x)s') % {b'x': b'aaa'}, b'aaa')
581+
self.assertEqual(bytes(b'%(x)s') % {b'x': bytes(b'aaa')}, b'aaa')
582582

583-
@unittest.skipUnless(utils.PY35 or utils.PY2,
583+
@unittest.skipUnless(utils.PY35_PLUS or utils.PY2,
584584
'test requires Python 2 or 3.5+')
585585
def test_mod(self):
586586
"""
@@ -606,7 +606,7 @@ def test_mod(self):
606606
a = b % (bytes(b'seventy-nine'), 79)
607607
self.assertEqual(a, b'seventy-nine / 100 = 79%')
608608

609-
@unittest.skipUnless(utils.PY35 or utils.PY2,
609+
@unittest.skipUnless(utils.PY35_PLUS or utils.PY2,
610610
'test requires Python 2 or 3.5+')
611611
def test_imod(self):
612612
"""

tests/test_future/test_urllibnet.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ def test_getcode(self):
109109

110110
# On Windows, socket handles are not file descriptors; this
111111
# test can't pass on Windows.
112-
@unittest.skipIf(sys.platform in ('win32',), 'not appropriate for Windows')
112+
@unittest.skipIf(sys.platform in ('darwin', 'win32',), 'not appropriate for Windows')
113+
@unittest.skipIf(utils.PY36_PLUS, 'test not applicable on Python 3.5 and higher')
113114
@skip26
114115
def test_fileno(self):
115116
# Make sure fd returned by fileno is valid.

0 commit comments

Comments
 (0)