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
4da5faae
Kaydet (Commit)
4da5faae
authored
Kas 01, 2009
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue 7244: Fix indentation in C code. Fix test to not sent output to stdout.
üst
6da85f94
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
test_itertools.py
Lib/test/test_itertools.py
+7
-4
No files found.
Lib/test/test_itertools.py
Dosyayı görüntüle @
4da5faae
...
@@ -422,7 +422,8 @@ class TestBasicOps(unittest.TestCase):
...
@@ -422,7 +422,8 @@ class TestBasicOps(unittest.TestCase):
def
run
(
r1
,
r2
):
def
run
(
r1
,
r2
):
result
=
[]
result
=
[]
for
i
,
j
in
izip_longest
(
r1
,
r2
,
fillvalue
=
0
):
for
i
,
j
in
izip_longest
(
r1
,
r2
,
fillvalue
=
0
):
print
(
i
,
j
)
with
test_support
.
captured_output
(
'stdout'
):
print
(
i
,
j
)
result
.
append
((
i
,
j
))
result
.
append
((
i
,
j
))
return
result
return
result
self
.
assertEqual
(
run
(
r1
,
r2
),
[(
1
,
2
),
(
1
,
2
),
(
1
,
2
),
(
0
,
2
)])
self
.
assertEqual
(
run
(
r1
,
r2
),
[(
1
,
2
),
(
1
,
2
),
(
1
,
2
),
(
0
,
2
)])
...
@@ -431,8 +432,11 @@ class TestBasicOps(unittest.TestCase):
...
@@ -431,8 +432,11 @@ class TestBasicOps(unittest.TestCase):
# and StopIteration would stop as expected
# and StopIteration would stop as expected
r1
=
Repeater
(
1
,
3
,
RuntimeError
)
r1
=
Repeater
(
1
,
3
,
RuntimeError
)
r2
=
Repeater
(
2
,
4
,
StopIteration
)
r2
=
Repeater
(
2
,
4
,
StopIteration
)
mylist
=
lambda
it
:
[
v
for
v
in
it
]
it
=
izip_longest
(
r1
,
r2
,
fillvalue
=
0
)
self
.
assertRaises
(
RuntimeError
,
mylist
,
izip_longest
(
r1
,
r2
,
fillvalue
=
0
))
self
.
assertEqual
(
next
(
it
),
(
1
,
2
))
self
.
assertEqual
(
next
(
it
),
(
1
,
2
))
self
.
assertEqual
(
next
(
it
),
(
1
,
2
))
self
.
assertRaises
(
RuntimeError
,
next
,
it
)
def
test_product
(
self
):
def
test_product
(
self
):
for
args
,
result
in
[
for
args
,
result
in
[
...
@@ -723,7 +727,6 @@ class TestBasicOps(unittest.TestCase):
...
@@ -723,7 +727,6 @@ class TestBasicOps(unittest.TestCase):
self
.
assertRaises
(
StopIteration
,
f
(
lambda
x
:
x
,
[])
.
next
)
self
.
assertRaises
(
StopIteration
,
f
(
lambda
x
:
x
,
[])
.
next
)
self
.
assertRaises
(
StopIteration
,
f
(
lambda
x
:
x
,
StopNow
())
.
next
)
self
.
assertRaises
(
StopIteration
,
f
(
lambda
x
:
x
,
StopNow
())
.
next
)
class
TestExamples
(
unittest
.
TestCase
):
class
TestExamples
(
unittest
.
TestCase
):
def
test_chain
(
self
):
def
test_chain
(
self
):
...
...
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