24
24
@support .requires_venv_with_pip ()
25
25
@support .requires_subprocess ()
26
26
@support .requires_resource ('cpu' )
27
- class TestCPPExt ( unittest . TestCase ) :
27
+ class BaseTests :
28
28
def test_build (self ):
29
29
self .check_build ('_testcppext' )
30
30
@@ -34,10 +34,6 @@ def test_build_cpp03(self):
34
34
# Please ask the C API WG before adding a new C++11-only feature.
35
35
self .check_build ('_testcpp03ext' , std = 'c++03' )
36
36
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
-
41
37
@unittest .skipIf (support .MS_WINDOWS , "MSVC doesn't support /std:c++11" )
42
38
def test_build_cpp11 (self ):
43
39
self .check_build ('_testcpp11ext' , std = 'c++11' )
@@ -48,10 +44,6 @@ def test_build_cpp11(self):
48
44
def test_build_cpp14 (self ):
49
45
self .check_build ('_testcpp14ext' , std = 'c++14' )
50
46
51
- @support .requires_gil_enabled ('incompatible with Free Threading' )
52
- def test_build_limited (self ):
53
- self .check_build ('_testcppext_limited' , limited = True )
54
-
55
47
def check_build (self , extension_name , std = None , limited = False ):
56
48
venv_dir = 'env'
57
49
with support .setup_venv_with_pip_setuptools (venv_dir ) as python_exe :
@@ -111,5 +103,19 @@ def run_cmd(operation, cmd):
111
103
run_cmd ('Import' , cmd )
112
104
113
105
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
+
114
120
if __name__ == "__main__" :
115
121
unittest .main ()
0 commit comments