|
1 | 1 | import ctypes |
2 | 2 | import sys |
3 | 3 | import unittest |
4 | | -import warnings |
5 | | -from ctypes import (Structure, Array, sizeof, addressof, |
| 4 | +from ctypes import (Structure, Array, ARRAY, sizeof, addressof, |
6 | 5 | create_string_buffer, create_unicode_buffer, |
7 | 6 | c_char, c_wchar, c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, |
8 | 7 | c_long, c_ulonglong, c_float, c_double, c_longdouble) |
|
17 | 16 | c_long, c_ulonglong, c_float, c_double, c_longdouble |
18 | 17 |
|
19 | 18 |
|
20 | | -def ARRAY(*args): |
21 | | - # ignore DeprecationWarning in tests |
22 | | - with warnings.catch_warnings(): |
23 | | - warnings.simplefilter('ignore', DeprecationWarning) |
24 | | - return ctypes.ARRAY(*args) |
25 | | - |
26 | | - |
27 | 19 | class ArrayTestCase(unittest.TestCase): |
28 | 20 | def test_inheritance_hierarchy(self): |
29 | 21 | self.assertEqual(Array.mro(), [Array, _CData, object]) |
@@ -275,10 +267,6 @@ def test_bpo36504_signed_int_overflow(self): |
275 | 267 | def test_large_array(self, size): |
276 | 268 | c_char * size |
277 | 269 |
|
278 | | - def test_deprecation(self): |
279 | | - with self.assertWarns(DeprecationWarning): |
280 | | - CharArray = ctypes.ARRAY(c_char, 3) |
281 | | - |
282 | 270 |
|
283 | 271 | if __name__ == '__main__': |
284 | 272 | unittest.main() |
0 commit comments