File tree Expand file tree Collapse file tree 3 files changed +11
-49
lines changed Expand file tree Collapse file tree 3 files changed +11
-49
lines changed Original file line number Diff line number Diff line change @@ -69,16 +69,16 @@ def test_dict_contains():
69
69
"""Test dict support for __contains__."""
70
70
71
71
ob = Test .PublicDictionaryTest ()
72
- items = ob .items
72
+ keys = ob .items . Keys
73
73
74
- assert '0' in items
75
- assert '1' in items
76
- assert '2' in items
77
- assert '3' in items
78
- assert '4' in items
74
+ assert '0' in keys
75
+ assert '1' in keys
76
+ assert '2' in keys
77
+ assert '3' in keys
78
+ assert '4' in keys
79
79
80
- assert not ('5' in items )
81
- assert not ('-1' in items )
80
+ assert not ('5' in keys )
81
+ assert not ('-1' in keys )
82
82
83
83
def test_dict_abuse ():
84
84
"""Test dict abuse."""
@@ -100,17 +100,6 @@ def test_dict_abuse():
100
100
with pytest .raises (TypeError ):
101
101
Test .PublicArrayTest .__getitem__ (0 , 0 )
102
102
103
- with pytest .raises (TypeError ):
104
- Test .PublicArrayTest .__setitem__ (0 , 0 , 0 )
105
-
106
- with pytest .raises (TypeError ):
107
- desc = Test .PublicArrayTest .__dict__ ['__getitem__' ]
108
- desc (0 , 0 )
109
-
110
- with pytest .raises (TypeError ):
111
- desc = Test .PublicArrayTest .__dict__ ['__setitem__' ]
112
- desc (0 , 0 , 0 )
113
-
114
103
def test_InheritedDictionary ():
115
104
"""Test class that inherited from IDictionary."""
116
105
items = Test .InheritedDictionaryTest ()
Original file line number Diff line number Diff line change @@ -120,14 +120,12 @@ def test_raise_instance_exception_with_args():
120
120
assert isinstance (exc , NullReferenceException )
121
121
assert exc .Message == 'Aiiieee!'
122
122
123
-
124
123
def test_managed_exception_propagation ():
125
124
"""Test propagation of exceptions raised in managed code."""
126
- from System import Decimal , OverflowException
127
-
128
- with pytest .raises (OverflowException ):
129
- Decimal .ToInt64 (Decimal .MaxValue )
125
+ from System import Decimal , DivideByZeroException
130
126
127
+ with pytest .raises (DivideByZeroException ):
128
+ Decimal .Divide (1 , 0 )
131
129
132
130
def test_managed_exception_conversion ():
133
131
"""Test conversion of managed exceptions."""
Original file line number Diff line number Diff line change @@ -333,31 +333,6 @@ def test_double_indexer():
333
333
ob ["wrong" ] = "wrong"
334
334
335
335
336
- def test_decimal_indexer ():
337
- """Test Decimal indexers."""
338
- ob = Test .DecimalIndexerTest ()
339
-
340
- from System import Decimal
341
- max_d = Decimal .Parse ("79228162514264337593543950335" )
342
- min_d = Decimal .Parse ("-79228162514264337593543950335" )
343
-
344
- assert ob [max_d ] is None
345
-
346
- ob [max_d ] = "max_"
347
- assert ob [max_d ] == "max_"
348
-
349
- ob [min_d ] = "min_"
350
- assert ob [min_d ] == "min_"
351
-
352
- with pytest .raises (TypeError ):
353
- ob = Test .DecimalIndexerTest ()
354
- ob ["wrong" ]
355
-
356
- with pytest .raises (TypeError ):
357
- ob = Test .DecimalIndexerTest ()
358
- ob ["wrong" ] = "wrong"
359
-
360
-
361
336
def test_string_indexer ():
362
337
"""Test String indexers."""
363
338
ob = Test .StringIndexerTest ()
You can’t perform that action at this time.
0 commit comments