summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_bool.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-05-12 07:37:58 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-05-12 07:37:58 (GMT)
commitea36c941a1b2ad6582a35bc42aa70da9600d2841 (patch)
treee915477a42189e490044a15d786a18382064bc1f /Lib/test/test_bool.py
parent9de7efe5ab40c19775dcc9ca88adf58d906fc53d (diff)
downloadcpython-ea36c941a1b2ad6582a35bc42aa70da9600d2841.zip
cpython-ea36c941a1b2ad6582a35bc42aa70da9600d2841.tar.gz
cpython-ea36c941a1b2ad6582a35bc42aa70da9600d2841.tar.bz2
Issue #23640: int.from_bytes() no longer bypasses constructors for subclasses.
Diffstat (limited to 'Lib/test/test_bool.py')
-rw-r--r--Lib/test/test_bool.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_bool.py b/Lib/test/test_bool.py
index 2507439..d30a3b9 100644
--- a/Lib/test/test_bool.py
+++ b/Lib/test/test_bool.py
@@ -314,6 +314,10 @@ class BoolTest(unittest.TestCase):
return -1
self.assertRaises(ValueError, bool, Eggs())
+ def test_from_bytes(self):
+ self.assertIs(bool.from_bytes(b'\x00'*8, 'big'), False)
+ self.assertIs(bool.from_bytes(b'abcd', 'little'), True)
+
def test_sane_len(self):
# this test just tests our assumptions about __len__
# this will start failing if __len__ changes assertions