Skip to content

Commit 579a197

Browse files
author
Jordan Adler
committed
Fix tests on Py3
1 parent e979fa3 commit 579a197

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

src/future/utils/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
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)
6060
PY2 = sys.version_info[0] == 2
6161
PY26 = sys.version_info[0:2] == (2, 6)
6262
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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ 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+
#
113+
# On macOS, this behavior is undocumented and this test fails.
114+
@unittest.skipIf(sys.platform in ('darwin', 'win32',), 'not appropriate for macOS or Windows')
113115
@skip26
114116
def test_fileno(self):
115117
# Make sure fd returned by fileno is valid.

0 commit comments

Comments
 (0)