Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
49e27f0a
Unverified
Kaydet (Commit)
49e27f0a
authored
May 01, 2019
tarafından
Chris Withers
Kaydeden (comit)
GitHub
May 01, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
remove jython support from unittest.mock (GH#13033)
üst
db719754
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
25 deletions
+2
-25
mock.py
Lib/unittest/mock.py
+2
-9
testmock.py
Lib/unittest/test/testmock/testmock.py
+0
-15
testpatch.py
Lib/unittest/test/testmock/testpatch.py
+0
-1
No files found.
Lib/unittest/mock.py
Dosyayı görüntüle @
49e27f0a
...
...
@@ -36,13 +36,6 @@ from functools import wraps, partial
_builtins
=
{
name
for
name
in
dir
(
builtins
)
if
not
name
.
startswith
(
'_'
)}
BaseExceptions
=
(
BaseException
,)
if
'java'
in
sys
.
platform
:
# jython
import
java
BaseExceptions
=
(
BaseException
,
java
.
lang
.
Throwable
)
FILTER_DIR
=
True
# Workaround for issue #12370
...
...
@@ -57,8 +50,8 @@ def _is_instance_mock(obj):
def
_is_exception
(
obj
):
return
(
isinstance
(
obj
,
BaseException
s
)
or
isinstance
(
obj
,
type
)
and
issubclass
(
obj
,
BaseException
s
)
isinstance
(
obj
,
BaseException
)
or
isinstance
(
obj
,
type
)
and
issubclass
(
obj
,
BaseException
)
)
...
...
Lib/unittest/test/testmock/testmock.py
Dosyayı görüntüle @
49e27f0a
...
...
@@ -184,21 +184,6 @@ class MockTest(unittest.TestCase):
mock
.
side_effect
=
ValueError
(
'Bazinga!'
)
self
.
assertRaisesRegex
(
ValueError
,
'Bazinga!'
,
mock
)
@unittest.skipUnless
(
'java'
in
sys
.
platform
,
'This test only applies to Jython'
)
def
test_java_exception_side_effect
(
self
):
import
java
mock
=
Mock
(
side_effect
=
java
.
lang
.
RuntimeException
(
"Boom!"
))
# can't use assertRaises with java exceptions
try
:
mock
(
1
,
2
,
fish
=
3
)
except
java
.
lang
.
RuntimeException
:
pass
else
:
self
.
fail
(
'java exception not raised'
)
mock
.
assert_called_with
(
1
,
2
,
fish
=
3
)
def
test_reset_mock
(
self
):
parent
=
Mock
()
...
...
Lib/unittest/test/testmock/testpatch.py
Dosyayı görüntüle @
49e27f0a
...
...
@@ -1312,7 +1312,6 @@ class PatchTest(unittest.TestCase):
def
test_patch_multiple_create_mocks_different_order
(
self
):
# bug revealed by Jython!
original_f
=
Foo
.
f
original_g
=
Foo
.
g
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment