2424@support .requires_venv_with_pip ()
2525@support .requires_subprocess ()
2626@support .requires_resource ('cpu' )
27- class TestCPPExt ( unittest . TestCase ) :
27+ class BaseTests :
2828 def test_build (self ):
2929 self .check_build ('_testcppext' )
3030
@@ -34,10 +34,6 @@ def test_build_cpp03(self):
3434 # Please ask the C API WG before adding a new C++11-only feature.
3535 self .check_build ('_testcpp03ext' , std = 'c++03' )
3636
37- @support .requires_gil_enabled ('incompatible with Free Threading' )
38- def test_build_limited_cpp03 (self ):
39- self .check_build ('_test_limited_cpp03ext' , std = 'c++03' , limited = True )
40-
4137 @unittest .skipIf (support .MS_WINDOWS , "MSVC doesn't support /std:c++11" )
4238 def test_build_cpp11 (self ):
4339 self .check_build ('_testcpp11ext' , std = 'c++11' )
@@ -48,10 +44,6 @@ def test_build_cpp11(self):
4844 def test_build_cpp14 (self ):
4945 self .check_build ('_testcpp14ext' , std = 'c++14' )
5046
51- @support .requires_gil_enabled ('incompatible with Free Threading' )
52- def test_build_limited (self ):
53- self .check_build ('_testcppext_limited' , limited = True )
54-
5547 def check_build (self , extension_name , std = None , limited = False ):
5648 venv_dir = 'env'
5749 with support .setup_venv_with_pip_setuptools (venv_dir ) as python_exe :
@@ -111,5 +103,19 @@ def run_cmd(operation, cmd):
111103 run_cmd ('Import' , cmd )
112104
113105
106+ class TestPublicCAPI (BaseTests , unittest .TestCase ):
107+ @support .requires_gil_enabled ('incompatible with Free Threading' )
108+ def test_build_limited_cpp03 (self ):
109+ self .check_build ('_test_limited_cpp03ext' , std = 'c++03' , limited = True )
110+
111+ @support .requires_gil_enabled ('incompatible with Free Threading' )
112+ def test_build_limited (self ):
113+ self .check_build ('_testcppext_limited' , limited = True )
114+
115+
116+ class TestInteralCAPI (BaseTests , unittest .TestCase ):
117+ TEST_INTERNAL_C_API = True
118+
119+
114120if __name__ == "__main__" :
115121 unittest .main ()
0 commit comments