summaryrefslogtreecommitdiff
path: root/Lib/test/test_bool.py
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2016-08-22 12:24:46 +0100
committerMark Dickinson <dickinsm@gmail.com>2016-08-22 12:24:46 +0100
commitb820d7f63132c1c6c1f301ee40be2b2729a61356 (patch)
tree0f99eb6240542ff49ddb0202dcd45a756fe2334f /Lib/test/test_bool.py
parent2eedc119c211a793d0c9a0beb1abd4bb12e0802e (diff)
downloadcpython-git-b820d7f63132c1c6c1f301ee40be2b2729a61356.tar.gz
Issue #27792: force int return type for modulo operations involving bools.
Diffstat (limited to 'Lib/test/test_bool.py')
-rw-r--r--Lib/test/test_bool.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_bool.py b/Lib/test/test_bool.py
index 5f7e842da2..9f8f0e122c 100644
--- a/Lib/test/test_bool.py
+++ b/Lib/test/test_bool.py
@@ -96,6 +96,13 @@ class BoolTest(unittest.TestCase):
self.assertEqual(False/1, 0)
self.assertIsNot(False/1, False)
+ self.assertEqual(True%1, 0)
+ self.assertIsNot(True%1, False)
+ self.assertEqual(True%2, 1)
+ self.assertIsNot(True%2, True)
+ self.assertEqual(False%1, 0)
+ self.assertIsNot(False%1, False)
+
for b in False, True:
for i in 0, 1, 2:
self.assertEqual(b**i, int(b)**i)