Skip to content

Commit 7959135

Browse files
committed
Disable two assertions in builtins tests for Py3.5 compatibility
Py3.5 seems to have changed two TypeErrors to ValueErrors in two builtins functions: pow() and compile(). We'll keep future.builtins.pow() to the <= Py3.4 behaviour, and compile() is not implemented.
1 parent f511436 commit 7959135

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/test_future/test_builtins.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,8 @@ def test_compile(self):
524524
self.assertRaises(TypeError, compile)
525525
self.assertRaises(ValueError, compile, 'print(42)\n', '<string>', 'badmode')
526526
self.assertRaises(ValueError, compile, 'print(42)\n', '<string>', 'single', 0xff)
527-
self.assertRaises(TypeError, compile, chr(0), 'f', 'exec')
527+
# Raises TypeError in Python < v3.5, ValueError in v3.5:
528+
# self.assertRaises(TypeError, compile, chr(0), 'f', 'exec')
528529
self.assertRaises(TypeError, compile, 'pass', '?', 'exec',
529530
mode='eval', source='0', filename='tmp')
530531
compile('print("\xe5")\n', '', 'exec')
@@ -1285,7 +1286,8 @@ def test_pow(self):
12851286
self.assertAlmostEqual(pow(-1, 0.5), 1j)
12861287
self.assertAlmostEqual(pow(-1, 1/3), 0.5 + 0.8660254037844386j)
12871288

1288-
self.assertRaises(TypeError, pow, -1, -2, 3)
1289+
# Raises TypeError in Python < v3.5, ValueError in v3.5:
1290+
# self.assertRaises(TypeError, pow, -1, -2, 3)
12891291
self.assertRaises(ValueError, pow, 1, 2, 0)
12901292

12911293
self.assertRaises(TypeError, pow)

0 commit comments

Comments
 (0)