Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(13404)

Side by Side Diff: Lib/test/test_sys.py

Issue 11682: PEP 380 reference implementation for 3.3
Patch Set: Created 7 years, 9 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 import unittest, test.support 1 import unittest, test.support
2 import sys, io, os 2 import sys, io, os
3 import struct 3 import struct
4 import subprocess 4 import subprocess
5 import textwrap 5 import textwrap
6 import warnings 6 import warnings
7 import operator 7 import operator
8 import codecs 8 import codecs
9 9
10 # count the number of test runs, used to create unique 10 # count the number of test runs, used to create unique
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 # sys.floatinfo 720 # sys.floatinfo
721 check(sys.float_info, size(vh) + self.P * len(sys.float_info)) 721 check(sys.float_info, size(vh) + self.P * len(sys.float_info))
722 # frame 722 # frame
723 import inspect 723 import inspect
724 CO_MAXBLOCKS = 20 724 CO_MAXBLOCKS = 20
725 x = inspect.currentframe() 725 x = inspect.currentframe()
726 ncells = len(x.f_code.co_cellvars) 726 ncells = len(x.f_code.co_cellvars)
727 nfrees = len(x.f_code.co_freevars) 727 nfrees = len(x.f_code.co_freevars)
728 extras = x.f_code.co_stacksize + x.f_code.co_nlocals +\ 728 extras = x.f_code.co_stacksize + x.f_code.co_nlocals +\
729 ncells + nfrees - 1 729 ncells + nfrees - 1
730 check(x, size(vh + '12P3i' + CO_MAXBLOCKS*'3i' + 'P' + extras*'P')) 730 check(x, size(vh + '13P3i' + CO_MAXBLOCKS*'3i' + 'P' + extras*'P'))
731 # function 731 # function
732 def func(): pass 732 def func(): pass
733 check(func, size(h + '12P')) 733 check(func, size(h + '12P'))
734 class c(): 734 class c():
735 @staticmethod 735 @staticmethod
736 def foo(): 736 def foo():
737 pass 737 pass
738 @classmethod 738 @classmethod
739 def bar(cls): 739 def bar(cls):
740 pass 740 pass
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
894 # XXX 894 # XXX
895 # sys.flags 895 # sys.flags
896 check(sys.flags, size(vh) + self.P * len(sys.flags)) 896 check(sys.flags, size(vh) + self.P * len(sys.flags))
897 897
898 898
899 def test_main(): 899 def test_main():
900 test.support.run_unittest(SysModuleTest, SizeofTest) 900 test.support.run_unittest(SysModuleTest, SizeofTest)
901 901
902 if __name__ == "__main__": 902 if __name__ == "__main__":
903 test_main() 903 test_main()
OLDNEW
« no previous file with comments | « Lib/test/test_pep380.py ('k') | Misc/ACKS » ('j') | Modules/parsermodule.c » ('J')

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+