File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,20 +33,11 @@ class Win_ValuesTestCase(unittest.TestCase):
3333 """This test only works when python itself is a dll/shared library"""
3434
3535 def test_optimizeflag (self ):
36- # This test accesses the Py_OptimizeFlag intger , which is
37- # exported by the Python dll.
36+ # This test accesses the Py_OptimizeFlag integer , which is
37+ # exported by the Python dll and should match the sys.flags value
3838
39- # It's value is set depending on the -O and -OO flags:
40- # if not given, it is 0 and __debug__ is 1.
41- # If -O is given, the flag is 1, for -OO it is 2.
42- # docstrings are also removed in the latter case.
4339 opt = c_int .in_dll (pythonapi , "Py_OptimizeFlag" ).value
44- if __debug__ :
45- self .assertEqual (opt , 0 )
46- elif ValuesTestCase .__doc__ is not None :
47- self .assertEqual (opt , 1 )
48- else :
49- self .assertEqual (opt , 2 )
40+ self .assertEqual (opt , sys .flags .optimize )
5041
5142 def test_frozentable (self ):
5243 # Python exports a PyImport_FrozenModules symbol. This is a
You can’t perform that action at this time.
0 commit comments