Skip to content

Commit f504307

Browse files
Disable peg generator tests when building with PGO
Otherwise, when running the testsuite, test_peg_generator tries to compile C code using the optimized flags and fails because it cannot find the profile data. https://bugs.python.org/issue42207
1 parent 212d32f commit f504307

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Lib/test/test_peg_generator/test_c_parser.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sysconfig
12
import textwrap
23
import unittest
34
from distutils.tests.support import TempdirManager
@@ -8,6 +9,10 @@
89
from test.support import os_helper
910
from test.support.script_helper import assert_python_ok
1011

12+
_pyflags_nodist = sysconfig.get_config_var('PY_CFLAGS_NODIST') or ()
13+
if sysconfig.get_config_var('PGO_PROF_USE_FLAG') in _pyflags_nodist:
14+
raise unittest.SkipTest("peg_generator test disabled when building with PGO")
15+
1116
test_tools.skip_if_missing("peg_generator")
1217
with test_tools.imports_under_tool("peg_generator"):
1318
from pegen.grammar_parser import GeneratedParser as GrammarParser

0 commit comments

Comments
 (0)