[Python-modules-commits] [python-future] 01/03: Properly fix assertion for pow and compile on Python 3.5

Vincent Bernat bernat at moszumanska.debian.org
Tue May 3 20:42:45 UTC 2016


This is an automated email from the git hooks/post-receive script.

bernat pushed a commit to branch master
in repository python-future.

commit 1c13f543c652141f38fb8f13ea264c548d7079c5
Author: Vincent Bernat <vincent at bernat.im>
Date:   Tue May 3 22:01:04 2016 +0200

    Properly fix assertion for pow and compile on Python 3.5
    
    Bug: https://github.com/PythonCharmers/python-future/pull/201
    
    Patch-Name: fix-tests-python3.5.patch
---
 tests/test_future/test_builtins.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tests/test_future/test_builtins.py b/tests/test_future/test_builtins.py
index a6db4fd..05d597a 100644
--- a/tests/test_future/test_builtins.py
+++ b/tests/test_future/test_builtins.py
@@ -525,11 +525,10 @@ class BuiltinTest(unittest.TestCase):
         self.assertRaises(ValueError, compile, 'print(42)\n', '<string>', 'badmode')
         self.assertRaises(ValueError, compile, 'print(42)\n', '<string>', 'single', 0xff)
         # Raises TypeError in Python < v3.5, ValueError in v3.5:
-        # self.assertRaises(TypeError, compile, chr(0), 'f', 'exec')
+        self.assertRaises((TypeError, ValueError), compile, chr(0), 'f', 'exec')
         self.assertRaises(TypeError, compile, 'pass', '?', 'exec',
                           mode='eval', source='0', filename='tmp')
         compile('print("\xe5")\n', '', 'exec')
-        self.assertRaises(TypeError, compile, chr(0), 'f', 'exec')
         self.assertRaises(ValueError, compile, str('a = 1'), 'f', 'bad')
 
         # test the optimize argument
@@ -1287,7 +1286,7 @@ class BuiltinTest(unittest.TestCase):
         self.assertAlmostEqual(pow(-1, 1/3), 0.5 + 0.8660254037844386j)
 
         # Raises TypeError in Python < v3.5, ValueError in v3.5:
-        # self.assertRaises(TypeError, pow, -1, -2, 3)
+        self.assertRaises((TypeError, ValueError), pow, -1, -2, 3)
         self.assertRaises(ValueError, pow, 1, 2, 0)
 
         self.assertRaises(TypeError, pow)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-future.git



More information about the Python-modules-commits mailing list