diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-05-12 10:39:32 +0300 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-05-12 10:39:32 +0300 |
commit | 1f364438adf1bcdc89a51af9af526ed9d7b7996d (patch) | |
tree | 2d620f18e63ff8703f4da17d98d0467a40a3c507 /Lib/test/test_bool.py | |
parent | 5787ef621a76dfe225308f0001d60e5e46e9a55f (diff) | |
parent | ea36c941a1b2ad6582a35bc42aa70da9600d2841 (diff) | |
download | cpython-git-1f364438adf1bcdc89a51af9af526ed9d7b7996d.tar.gz |
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.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_bool.py b/Lib/test/test_bool.py index 250743949b..d30a3b9c0f 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 |