Skip to content

Commit 1050d7f

Browse files
authored
Merge pull request #355 from sbraz/py37
Fix tests for Python 3.7
2 parents 11ff71d + 2218d6f commit 1050d7f

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

tests/test_future/test_httplib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def test_bad_status_repr(self):
197197
if not utils.PY3:
198198
self.assertEqual(repr(exc), '''BadStatusLine("u\'\'",)''')
199199
else:
200-
self.assertEqual(repr(exc), '''BadStatusLine("\'\'",)''')
200+
self.assertIn(repr(exc), ('''BadStatusLine("''",)''', '''BadStatusLine("''")'''))
201201

202202
def test_partial_reads(self):
203203
# if we have a length, the system knows when to close itself

tests/test_future/test_int.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,12 +265,17 @@ def test_small_ints(self):
265265
def test_no_args(self):
266266
self.assertEqual(int(), 0)
267267

268-
def test_keyword_args(self):
268+
@unittest.skipIf(sys.version_info >= (3, 7),
269+
"The first parameter must be positional with Python >= 3.7"
270+
)
271+
def test_x_keyword_arg(self):
269272
# Test invoking int() using keyword arguments.
270273
self.assertEqual(int(x=1.2), 1)
271-
self.assertEqual(int('100', base=2), 4)
272274
self.assertEqual(int(x='100', base=2), 4)
273275

276+
def text_base_keyword_arg(self):
277+
self.assertEqual(int('100', base=2), 4)
278+
274279
def test_newint_plus_float(self):
275280
minutes = int(100)
276281
second = 0.0

0 commit comments

Comments
 (0)