File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99import sys
1010import unittest
1111import locale
12+ import sysconfig
1213
1314from test .support import run_unittest , findfile
1415
@@ -664,6 +665,15 @@ def test_locals_after_up(self):
664665 r".*\na = 1\nb = 2\nc = 3\n.*" )
665666
666667def test_main ():
668+ cflags = sysconfig .get_config_vars ()['PY_CFLAGS' ]
669+ final_opt = ""
670+ for opt in cflags .split ():
671+ if opt .startswith ('-O' ):
672+ final_opt = opt
673+ if final_opt and final_opt != '-O0' :
674+ raise unittest .SkipTest ("Python was built with compiler optimizations, "
675+ "tests can't reliably succeed" )
676+
667677 run_unittest (PrettyPrintTests ,
668678 PyListTests ,
669679 StackNavigationTests ,
Original file line number Diff line number Diff line change @@ -1614,6 +1614,8 @@ Documentation
16141614Tests
16151615-----
16161616
1617+ - Issue #8605: Skip test_gdb if Python is compiled with optimizations.
1618+
16171619- Issue #7449: Skip test_socketserver if threading support is disabled
16181620
16191621- Issue #8672: Add a zlib test ensuring that an incomplete stream can be
You can’t perform that action at this time.
0 commit comments