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
c10c34d6
Kaydet (Commit)
c10c34d6
authored
Ock 17, 2009
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Make test_io faster
üst
fdaa3a30
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
test_io.py
Lib/test/test_io.py
+5
-1
No files found.
Lib/test/test_io.py
Dosyayı görüntüle @
c10c34d6
...
...
@@ -1021,6 +1021,10 @@ class TextIOWrapperTest(unittest.TestCase):
def
testSeekAndTell
(
self
):
"""Test seek/tell using the StatefulIncrementalDecoder."""
# Make this test faster by forcing a smaller (but large enough)
# chunk size. The bigger the chunker size, the slower seek() is,
# as it tries to replay character decoding one byte at a time.
CHUNK_SIZE
=
256
def
testSeekAndTellWithData
(
data
,
min_pos
=
0
):
"""Tell/seek to various points within a data stream and ensure
...
...
@@ -1035,6 +1039,7 @@ class TextIOWrapperTest(unittest.TestCase):
for
i
in
range
(
min_pos
,
len
(
decoded
)
+
1
):
# seek positions
for
j
in
[
1
,
5
,
len
(
decoded
)
-
i
]:
# read lengths
f
=
io
.
open
(
support
.
TESTFN
,
encoding
=
'test_decoder'
)
f
.
_CHUNK_SIZE
=
CHUNK_SIZE
self
.
assertEquals
(
f
.
read
(
i
),
decoded
[:
i
])
cookie
=
f
.
tell
()
self
.
assertEquals
(
f
.
read
(
j
),
decoded
[
i
:
i
+
j
])
...
...
@@ -1052,7 +1057,6 @@ class TextIOWrapperTest(unittest.TestCase):
testSeekAndTellWithData
(
input
)
# Position each test case so that it crosses a chunk boundary.
CHUNK_SIZE
=
io
.
TextIOWrapper
.
_CHUNK_SIZE
for
input
,
_
,
_
in
StatefulIncrementalDecoderTest
.
test_cases
:
offset
=
CHUNK_SIZE
-
len
(
input
)
//
2
prefix
=
b
'.'
*
offset
...
...
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