File tree 3 files changed +2
-25
lines changed
3 files changed +2
-25
lines changed Original file line number Diff line number Diff line change 36
36
37
37
_builtins = {name for name in dir (builtins ) if not name .startswith ('_' )}
38
38
39
- BaseExceptions = (BaseException ,)
40
- if 'java' in sys .platform :
41
- # jython
42
- import java
43
- BaseExceptions = (BaseException , java .lang .Throwable )
44
-
<
10000
/tr>45
-
46
39
FILTER_DIR = True
47
40
48
41
# Workaround for issue #12370
@@ -57,8 +50,8 @@ def _is_instance_mock(obj):
57
50
58
51
def _is_exception (obj ):
59
52
return (
60
- isinstance (obj , BaseExceptions ) or
61
- isinstance (obj , type ) and issubclass (obj , BaseExceptions )
53
+ isinstance (obj , BaseException ) or
54
+ isinstance (obj , type ) and issubclass (obj , BaseException )
62
55
)
63
56
64
57
Original file line number Diff line number Diff line change @@ -184,21 +184,6 @@ def f():
184
184
mock .side_effect = ValueError ('Bazinga!' )
185
185
self .assertRaisesRegex (ValueError , 'Bazinga!' , mock )
186
186
187
- @unittest .skipUnless ('java' in sys .platform ,
188
- 'This test only applies to Jython' )
189
- def test_java_exception_side_effect (self ):
190
- import java
191
- mock = Mock (side_effect = java .lang .RuntimeException ("Boom!" ))
192
-
193
- # can't use assertRaises with java exceptions
194
- try :
195
- mock (1 , 2 , fish = 3 )
196
- except java .lang .RuntimeException :
197
- pass
198
- else :
199
- self .fail ('java exception not raised' )
200
- mock .assert_called_with (1 ,2 , fish = 3 )
201
-
202
187
203
188
def test_reset_mock (self ):
204
189
parent = Mock ()
Original file line number Diff line number Diff line change @@ -1312,7 +1312,6 @@ def test(f, foo):
1312
1312
1313
1313
1314
1314
def test_patch_multiple_create_mocks_different_order (self ):
1315
- # bug revealed by Jython!
1316
1315
original_f = Foo .f
1317
1316
original_g = Foo .g
1318
1317
You can’t perform that action at this time.
0 commit comments