Issue #21526: Fixed the test_booleans test for wantobjects = 0.

This commit is contained in:
Serhiy Storchaka 2015-04-02 11:46:07 +03:00
parent f7de3dd02d
commit 9171fe5a1d
1 changed files with 6 additions and 2 deletions

View File

@ -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)