File tree Expand file tree Collapse file tree 2 files changed +6
-14
lines changed Expand file tree Collapse file tree 2 files changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -35,34 +35,24 @@ def test_mro(self):
35
35
# wasn't checked, and it even crashed Python.
36
36
# Found by Greg Chapman.
37
37
38
- try :
38
+ with self . assertRaises ( TypeError ) :
39
39
class X (object , Array ):
40
40
_length_ = 5
41
41
_type_ = "i"
42
- except TypeError :
43
- pass
44
-
45
42
46
43
from _ctypes import _Pointer
47
- try :
44
+ with self . assertRaises ( TypeError ) :
48
45
class X (object , _Pointer ):
49
46
pass
50
- except TypeError :
51
- pass
52
47
53
48
from _ctypes import _SimpleCData
54
- try :
49
+ with self . assertRaises ( TypeError ) :
55
50
class X (object , _SimpleCData ):
56
51
_type_ = "i"
57
- except TypeError :
58
- pass
59
52
60
- try :
53
+ with self . assertRaises ( TypeError ) :
61
54
class X (object , Structure ):
62
55
_fields_ = []
63
- except TypeError :
64
- pass
65
-
66
56
67
57
@need_symbol ('c_wchar' )
68
58
def test_wchar_parm (self ):
Original file line number Diff line number Diff line change
1
+ Test ``Lib/ctypes/test/test_functions.py::test_mro `` now uses
2
+ ``self.assertRaises `` instead of ``try/except ``.
You can’t perform that action at this time.
0 commit comments