@@ -41,12 +41,17 @@ def test_build_cpp11(self):
4141 def test_build_cpp14 (self ):
4242 self .check_build ('_testcpp14ext' , std = 'c++14' )
4343
44- def check_build (self , extension_name , std = None ):
44+ @support .requires_gil_enabled ('incompatible with Free Threading' )
45+ def test_build_limited (self ):
46+ self .check_build ('_testcppext_limited' , limited = True )
47+
48+ def check_build (self , extension_name , std = None , limited = False ):
4549 venv_dir = 'env'
4650 with support .setup_venv_with_pip_setuptools_wheel (venv_dir ) as python_exe :
47- self ._check_build (extension_name , python_exe , std = std )
51+ self ._check_build (extension_name , python_exe ,
52+ std = std , limited = limited )
4853
49- def _check_build (self , extension_name , python_exe , std ):
54+ def _check_build (self , extension_name , python_exe , std , limited ):
5055 pkg_dir = 'pkg'
5156 os .mkdir (pkg_dir )
5257 shutil .copy (SETUP , os .path .join (pkg_dir , os .path .basename (SETUP )))
@@ -56,6 +61,8 @@ def run_cmd(operation, cmd):
5661 env = os .environ .copy ()
5762 if std :
5863 env ['CPYTHON_TEST_CPP_STD' ] = std
64+ if limited :
65+ env ['CPYTHON_TEST_LIMITED' ] = '1'
5966 env ['CPYTHON_TEST_EXT_NAME' ] = extension_name
6067 if support .verbose :
6168 print ('Run:' , ' ' .join (map (shlex .quote , cmd )))
0 commit comments