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
e9ad5a57
Kaydet (Commit)
e9ad5a57
authored
May 09, 2015
tarafından
Yury Selivanov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue 22906: Add test file.
üst
8170e8c0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
test_pep479.py
Lib/test/test_pep479.py
+34
-0
No files found.
Lib/test/test_pep479.py
0 → 100644
Dosyayı görüntüle @
e9ad5a57
from
__future__
import
generator_stop
import
unittest
class
TestPEP479
(
unittest
.
TestCase
):
def
test_stopiteration_wrapping
(
self
):
def
f
():
raise
StopIteration
def
g
():
yield
f
()
with
self
.
assertRaisesRegex
(
RuntimeError
,
"generator raised StopIteration"
):
next
(
g
())
def
test_stopiteration_wrapping_context
(
self
):
def
f
():
raise
StopIteration
def
g
():
yield
f
()
try
:
next
(
g
())
except
RuntimeError
as
exc
:
self
.
assertIs
(
type
(
exc
.
__cause__
),
StopIteration
)
self
.
assertIs
(
type
(
exc
.
__context__
),
StopIteration
)
self
.
assertTrue
(
exc
.
__suppress_context__
)
else
:
self
.
fail
(
'__cause__, __context__, or __suppress_context__ '
'were not properly set'
)
if
__name__
==
'__main__'
:
unittest
.
main
()
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