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
19dea2c7
Kaydet (Commit)
19dea2c7
authored
Ock 21, 2017
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #28735: Fixed the comparison of mock.MagickMock with mock.ANY.
üst
7cf8bebb
a2033608
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
5 deletions
+22
-5
mock.py
Lib/unittest/mock.py
+6
-2
testmock.py
Lib/unittest/test/testmock/testmock.py
+14
-3
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/unittest/mock.py
Dosyayı görüntüle @
19dea2c7
...
@@ -1765,14 +1765,18 @@ def _get_eq(self):
...
@@ -1765,14 +1765,18 @@ def _get_eq(self):
ret_val
=
self
.
__eq__
.
_mock_return_value
ret_val
=
self
.
__eq__
.
_mock_return_value
if
ret_val
is
not
DEFAULT
:
if
ret_val
is
not
DEFAULT
:
return
ret_val
return
ret_val
return
self
is
other
if
self
is
other
:
return
True
return
NotImplemented
return
__eq__
return
__eq__
def
_get_ne
(
self
):
def
_get_ne
(
self
):
def
__ne__
(
other
):
def
__ne__
(
other
):
if
self
.
__ne__
.
_mock_return_value
is
not
DEFAULT
:
if
self
.
__ne__
.
_mock_return_value
is
not
DEFAULT
:
return
DEFAULT
return
DEFAULT
return
self
is
not
other
if
self
is
other
:
return
False
return
NotImplemented
return
__ne__
return
__ne__
def
_get_iter
(
self
):
def
_get_iter
(
self
):
...
...
Lib/unittest/test/testmock/testmock.py
Dosyayı görüntüle @
19dea2c7
...
@@ -306,13 +306,24 @@ class MockTest(unittest.TestCase):
...
@@ -306,13 +306,24 @@ class MockTest(unittest.TestCase):
def
test_calls_equal_with_any
(
self
):
def
test_calls_equal_with_any
(
self
):
call1
=
mock
.
call
(
mock
.
MagicMock
())
call2
=
mock
.
call
(
mock
.
ANY
)
# Check that equality and non-equality is consistent even when
# Check that equality and non-equality is consistent even when
# comparing with mock.ANY
# comparing with mock.ANY
mm
=
mock
.
MagicMock
()
self
.
assertTrue
(
mm
==
mm
)
self
.
assertFalse
(
mm
!=
mm
)
self
.
assertFalse
(
mm
==
mock
.
MagicMock
())
self
.
assertTrue
(
mm
!=
mock
.
MagicMock
())
self
.
assertTrue
(
mm
==
mock
.
ANY
)
self
.
assertFalse
(
mm
!=
mock
.
ANY
)
self
.
assertTrue
(
mock
.
ANY
==
mm
)
self
.
assertFalse
(
mock
.
ANY
!=
mm
)
call1
=
mock
.
call
(
mock
.
MagicMock
())
call2
=
mock
.
call
(
mock
.
ANY
)
self
.
assertTrue
(
call1
==
call2
)
self
.
assertTrue
(
call1
==
call2
)
self
.
assertFalse
(
call1
!=
call2
)
self
.
assertFalse
(
call1
!=
call2
)
self
.
assertTrue
(
call2
==
call1
)
self
.
assertFalse
(
call2
!=
call1
)
def
test_assert_called_with
(
self
):
def
test_assert_called_with
(
self
):
...
...
Misc/NEWS
Dosyayı görüntüle @
19dea2c7
...
@@ -215,6 +215,8 @@ Core and Builtins
...
@@ -215,6 +215,8 @@ Core and Builtins
Library
Library
-------
-------
-
Issue
#
28735
:
Fixed
the
comparison
of
mock
.
MagickMock
with
mock
.
ANY
.
-
Issue
#
29197
:
Removed
deprecated
function
ntpath
.
splitunc
().
-
Issue
#
29197
:
Removed
deprecated
function
ntpath
.
splitunc
().
-
Issue
#
29210
:
Removed
support
of
deprecated
argument
"exclude"
in
-
Issue
#
29210
:
Removed
support
of
deprecated
argument
"exclude"
in
...
...
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