diff options
Diffstat (limited to 'pypy/module/cpyext/test/test_cpyext.py')
-rw-r--r-- | pypy/module/cpyext/test/test_cpyext.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/pypy/module/cpyext/test/test_cpyext.py b/pypy/module/cpyext/test/test_cpyext.py index 3b5d41bf38..c7d2671a05 100644 --- a/pypy/module/cpyext/test/test_cpyext.py +++ b/pypy/module/cpyext/test/test_cpyext.py @@ -939,3 +939,15 @@ class AppTestCpythonExtension(AppTestCpythonExtensionBase): ''' ), ]) + + def test_consistent_flags(self): + import sys + mod = self.import_extension('foo', [ + ('test_optimize', 'METH_NOARGS', + ''' + return PyLong_FromLong(Py_OptimizeFlag); + '''), + ]) + # This is intentionally set to -1 by default from missing.c + # and should be set to sys.flags.optimize at startup + assert mod.test_optimize() == sys.flags.optimize |