[Python-checkins] cpython (merge 3.4 -> default): Issue #21829: Merge with 3.4

zach.ware python-checkins at python.org
Thu Jun 26 22:22:36 CEST 2014


http://hg.python.org/cpython/rev/bbb28082d7b4
changeset: 91430:bbb28082d7b4
parent: 91428:a3ee325fd489
parent: 91429:ab708e4131dd
user: Zachary Ware <zachary.ware at gmail.com>
date: Thu Jun 26 15:22:16 2014 -0500
summary:
 Issue #21829: Merge with 3.4
files:
 Lib/ctypes/test/test_values.py | 15 +++------------
 1 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/Lib/ctypes/test/test_values.py b/Lib/ctypes/test/test_values.py
--- a/Lib/ctypes/test/test_values.py
+++ b/Lib/ctypes/test/test_values.py
@@ -33,20 +33,11 @@
 """This test only works when python itself is a dll/shared library"""
 
 def test_optimizeflag(self):
- # This test accesses the Py_OptimizeFlag intger, which is
- # exported by the Python dll.
+ # This test accesses the Py_OptimizeFlag integer, which is
+ # exported by the Python dll and should match the sys.flags value
 
- # It's value is set depending on the -O and -OO flags:
- # if not given, it is 0 and __debug__ is 1.
- # If -O is given, the flag is 1, for -OO it is 2.
- # docstrings are also removed in the latter case.
 opt = c_int.in_dll(pythonapi, "Py_OptimizeFlag").value
- if __debug__:
- self.assertEqual(opt, 0)
- elif ValuesTestCase.__doc__ is not None:
- self.assertEqual(opt, 1)
- else:
- self.assertEqual(opt, 2)
+ self.assertEqual(opt, sys.flags.optimize)
 
 def test_frozentable(self):
 # Python exports a PyImport_FrozenModules symbol. This is a
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /