summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-04-02 08:46:07 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-04-02 08:46:07 (GMT)
commit9171fe5a1dfe74f381a0ec8648568b5d04fa0664 (patch)
tree15ac1ae75f0aa67b4768146a5012206b8093fc5c /Lib/test
parentf7de3dd02d5186f30f69b80f5ee00376581f1d23 (diff)
downloadcpython-9171fe5a1dfe74f381a0ec8648568b5d04fa0664.zip
cpython-9171fe5a1dfe74f381a0ec8648568b5d04fa0664.tar.gz
cpython-9171fe5a1dfe74f381a0ec8648568b5d04fa0664.tar.bz2
Issue #21526: Fixed the test_booleans test for wantobjects = 0.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_tcl.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_tcl.py b/Lib/test/test_tcl.py
index d01f969..c9410a9 100644
--- a/Lib/test/test_tcl.py
+++ b/Lib/test/test_tcl.py
@@ -382,8 +382,12 @@ class TclTest(unittest.TestCase):
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)