[Python-checkins] cpython (2.7): Issue #21526: Fixed the test_booleans test for wantobjects = 0.

serhiy.storchaka python-checkins at python.org
Thu Apr 2 10:48:22 CEST 2015


https://hg.python.org/cpython/rev/954e7e1d85f1
changeset:   95372:954e7e1d85f1
branch:      2.7
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Thu Apr 02 11:46:07 2015 +0300
summary:
  Issue #21526: Fixed the test_booleans test for wantobjects = 0.

files:
  Lib/test/test_tcl.py |  8 ++++++--
  1 files changed, 6 insertions(+), 2 deletions(-)


diff --git a/Lib/test/test_tcl.py b/Lib/test/test_tcl.py
--- a/Lib/test/test_tcl.py
+++ b/Lib/test/test_tcl.py
@@ -395,8 +395,12 @@
         tcl = self.interp
         def check(expr, expected):
             result = tcl.call('expr', expr)
-            self.assertEqual(result, expected)
-            self.assertIsInstance(result, int)
+            if tcl.wantobjects():
+                self.assertEqual(result, expected)
+                self.assertIsInstance(result, int)
+            else:
+                self.assertIn(result, (expr, str(int(expected))))
+                self.assertIsInstance(result, str)
         check('true', True)
         check('yes', True)
         check('on', True)

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list