99from test .support import import_helper
1010
1111_testcapi = import_helper .import_module ('_testcapi' )
12+ _testlimitedcapi = import_helper .import_module ('_testlimitedcapi' )
1213
1314NULL = None
1415
2930class CAPIFloatTest (unittest .TestCase ):
3031 def test_check (self ):
3132 # Test PyFloat_Check()
32- check = _testcapi .float_check
33+ check = _testlimitedcapi .float_check
3334
3435 self .assertTrue (check (4.25 ))
3536 self .assertTrue (check (FloatSubclass (4.25 )))
@@ -41,7 +42,7 @@ def test_check(self):
4142
4243 def test_checkexact (self ):
4344 # Test PyFloat_CheckExact()
44- checkexact = _testcapi .float_checkexact
45+ checkexact = _testlimitedcapi .float_checkexact
4546
4647 self .assertTrue (checkexact (4.25 ))
4748 self .assertFalse (checkexact (FloatSubclass (4.25 )))
@@ -53,7 +54,7 @@ def test_checkexact(self):
5354
5455 def test_fromstring (self ):
5556 # Test PyFloat_FromString()
56- fromstring = _testcapi .float_fromstring
57+ fromstring = _testlimitedcapi .float_fromstring
5758
5859 self .assertEqual (fromstring ("4.25" ), 4.25 )
5960 self .assertEqual (fromstring (b"4.25" ), 4.25 )
@@ -72,13 +73,13 @@ def test_fromstring(self):
7273
7374 def test_fromdouble (self ):
7475 # Test PyFloat_FromDouble()
75- fromdouble = _testcapi .float_fromdouble
76+ fromdouble = _testlimitedcapi .float_fromdouble
7677
7778 self .assertEqual (fromdouble (4.25 ), 4.25 )
7879
7980 def test_asdouble (self ):
8081 # Test PyFloat_AsDouble()
81- asdouble = _testcapi .float_asdouble
82+ asdouble = _testlimitedcapi .float_asdouble
8283
8384 class BadFloat3 :
8485 def __float__ (self ):
@@ -109,19 +110,19 @@ def __float__(self):
109110
110111 def test_getinfo (self ):
111112 # Test PyFloat_GetInfo()
112- getinfo = _testcapi .float_getinfo
113+ getinfo = _testlimitedcapi .float_getinfo
113114
114115 self .assertEqual (getinfo (), sys .float_info )
115116
116117 def test_getmax (self ):
117118 # Test PyFloat_GetMax()
118- getmax = _testcapi .float_getmax
119+ getmax = _testlimitedcapi .float_getmax
119120
120121 self .assertEqual (getmax (), sys .float_info .max )
121122
122123 def test_getmin (self ):
123124 # Test PyFloat_GetMax()
124- getmin = _testcapi .float_getmin
125+ getmin = _testlimitedcapi .float_getmin
125126
126127 self .assertEqual (getmin (), sys .float_info .min )
127128
0 commit comments