diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-09-10 04:51:19 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-09-10 04:51:19 (GMT) |
commit | a1fd0789ed8ba174062d6fe5e55fd8d008055bd2 (patch) | |
tree | 68da385f6f0f63306d52e4d73bbe46d9b1e48a7d /Lib/test/test_sys.py | |
parent | fef7e94fa12f21c09997bd02809e677830966646 (diff) | |
download | cpython-a1fd0789ed8ba174062d6fe5e55fd8d008055bd2.zip cpython-a1fd0789ed8ba174062d6fe5e55fd8d008055bd2.tar.gz cpython-a1fd0789ed8ba174062d6fe5e55fd8d008055bd2.tar.bz2 |
Try to fix sizeof unit tests on dict
Issue #28056 and issue #26058.
Diffstat (limited to 'Lib/test/test_sys.py')
-rw-r--r-- | Lib/test/test_sys.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index 37ee0b0..df9ebd4 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -937,9 +937,9 @@ class SizeofTest(unittest.TestCase): # method-wrapper (descriptor object) check({}.__iter__, size('2P')) # dict - check({}, size('n2P') + 8 + calcsize('2nP2n') + 8 + (8*2//3)*calcsize('n2P')) + check({}, size('nQ2P') + calcsize('2nP2n') + 8 + (8*2//3)*calcsize('n2P')) longdict = {1:1, 2:2, 3:3, 4:4, 5:5, 6:6, 7:7, 8:8} - check(longdict, size('n2P') + 8 + calcsize('2nP2n') + 16 + (16*2//3)*calcsize('n2P')) + check(longdict, size('nQ2P') + calcsize('2nP2n') + 16 + (16*2//3)*calcsize('n2P')) # dictionary-keyview check({}.keys(), size('P')) # dictionary-valueview @@ -1103,7 +1103,7 @@ class SizeofTest(unittest.TestCase): class newstyleclass(object): pass check(newstyleclass, s) # dict with shared keys - check(newstyleclass().__dict__, size('n2P' + '2nP2n') + 8) + check(newstyleclass().__dict__, size('nQ2P' + '2nP2n')) # unicode # each tuple contains a string and its expected character size # don't put any static strings here, as they may contain |