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
161a4dd4
Kaydet (Commit)
161a4dd4
authored
Ara 15, 2016
tarafından
Berker Peksag
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #28919: Simplify _copy_func_details() in unittest.mock
Patch by Jiajun Huang.
üst
e660327c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
18 deletions
+8
-18
mock.py
Lib/unittest/mock.py
+8
-18
No files found.
Lib/unittest/mock.py
Dosyayı görüntüle @
161a4dd4
...
...
@@ -104,26 +104,16 @@ def _check_signature(func, mock, skipfirst, instance=False):
def
_copy_func_details
(
func
,
funcopy
):
funcopy
.
__name__
=
func
.
__name__
funcopy
.
__doc__
=
func
.
__doc__
try
:
funcopy
.
__text_signature__
=
func
.
__text_signature__
except
AttributeError
:
pass
# we explicitly don't copy func.__dict__ into this copy as it would
# expose original attributes that should be mocked
try
:
funcopy
.
__module__
=
func
.
__module__
except
AttributeError
:
pass
try
:
funcopy
.
__defaults__
=
func
.
__defaults__
except
AttributeError
:
pass
try
:
funcopy
.
__kwdefaults__
=
func
.
__kwdefaults__
except
AttributeError
:
pass
for
attribute
in
(
'__name__'
,
'__doc__'
,
'__text_signature__'
,
'__module__'
,
'__defaults__'
,
'__kwdefaults__'
,
):
try
:
setattr
(
funcopy
,
attribute
,
getattr
(
func
,
attribute
))
except
AttributeError
:
pass
def
_callable
(
obj
):
...
...
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