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
5dc3e3f1
Kaydet (Commit)
5dc3e3f1
authored
Haz 13, 2006
tarafından
Brett Cannon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Missed test for rev. 46933; infinite recursion from __coerce__() returning its arguments reversed.
üst
1541ef08
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
test_coercion.py
Lib/test/test_coercion.py
+19
-1
No files found.
Lib/test/test_coercion.py
Dosyayı görüntüle @
5dc3e3f1
...
...
@@ -2,7 +2,7 @@ import copy
import
sys
import
warnings
import
unittest
from
test.test_support
import
run_unittest
from
test.test_support
import
run_unittest
,
TestFailed
# Fake a number that implements numeric methods through __coerce__
class
CoerceNumber
:
...
...
@@ -318,6 +318,24 @@ class CoercionTest(unittest.TestCase):
return
0
self
.
assertEquals
(
cmp
(
ClassicWackyComparer
(),
evil_coercer
),
0
)
def
test_infinite_rec_classic_classes
(
self
):
# if __coerce__() returns its arguments reversed it causes an infinite
# recursion for classic classes.
class
Tester
:
def
__coerce__
(
self
,
other
):
return
other
,
self
exc
=
TestFailed
(
"__coerce__() returning its arguments reverse "
"should raise RuntimeError"
)
try
:
Tester
()
+
1
except
(
RuntimeError
,
TypeError
):
return
except
:
raise
exc
else
:
raise
exc
def
test_main
():
warnings
.
filterwarnings
(
"ignore"
,
r'complex divmod\(\), // and
%
are deprecated'
,
...
...
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