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

This commit is contained in:
Serhiy Storchaka 2015-04-02 11:47:51 +03:00
commit b7616621db
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)