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
24fb1d0a
Kaydet (Commit)
24fb1d0a
authored
Nis 24, 2009
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
these tests must call gc_collect() for non-refcounting gcs
üst
45cec32f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
test_io.py
Lib/test/test_io.py
+10
-4
No files found.
Lib/test/test_io.py
Dosyayı görüntüle @
24fb1d0a
...
@@ -400,6 +400,7 @@ class IOTest(unittest.TestCase):
...
@@ -400,6 +400,7 @@ class IOTest(unittest.TestCase):
f
=
MyFileIO
(
support
.
TESTFN
,
"wb"
)
f
=
MyFileIO
(
support
.
TESTFN
,
"wb"
)
f
.
write
(
b
"xxx"
)
f
.
write
(
b
"xxx"
)
del
f
del
f
support
.
gc_collect
()
self
.
assertEqual
(
record
,
[
1
,
2
,
3
])
self
.
assertEqual
(
record
,
[
1
,
2
,
3
])
with
open
(
support
.
TESTFN
,
"rb"
)
as
f
:
with
open
(
support
.
TESTFN
,
"rb"
)
as
f
:
self
.
assertEqual
(
f
.
read
(),
b
"xxx"
)
self
.
assertEqual
(
f
.
read
(),
b
"xxx"
)
...
@@ -431,6 +432,7 @@ class IOTest(unittest.TestCase):
...
@@ -431,6 +432,7 @@ class IOTest(unittest.TestCase):
super
()
.
flush
()
super
()
.
flush
()
f
=
MyIO
()
f
=
MyIO
()
del
f
del
f
support
.
gc_collect
()
self
.
assertEqual
(
record
,
[
1
,
2
,
3
])
self
.
assertEqual
(
record
,
[
1
,
2
,
3
])
def
test_IOBase_destructor
(
self
):
def
test_IOBase_destructor
(
self
):
...
@@ -493,7 +495,7 @@ class IOTest(unittest.TestCase):
...
@@ -493,7 +495,7 @@ class IOTest(unittest.TestCase):
f
.
f
=
f
f
.
f
=
f
wr
=
weakref
.
ref
(
f
)
wr
=
weakref
.
ref
(
f
)
del
f
del
f
gc
.
collect
()
support
.
gc_
collect
()
self
.
assert_
(
wr
()
is
None
,
wr
)
self
.
assert_
(
wr
()
is
None
,
wr
)
with
open
(
support
.
TESTFN
,
"rb"
)
as
f
:
with
open
(
support
.
TESTFN
,
"rb"
)
as
f
:
self
.
assertEqual
(
f
.
read
(),
b
"abcxxx"
)
self
.
assertEqual
(
f
.
read
(),
b
"abcxxx"
)
...
@@ -564,6 +566,7 @@ class CommonBufferedTests:
...
@@ -564,6 +566,7 @@ class CommonBufferedTests:
bufio
=
MyBufferedIO
(
rawio
)
bufio
=
MyBufferedIO
(
rawio
)
writable
=
bufio
.
writable
()
writable
=
bufio
.
writable
()
del
bufio
del
bufio
support
.
gc_collect
()
if
writable
:
if
writable
:
self
.
assertEqual
(
record
,
[
1
,
2
,
3
])
self
.
assertEqual
(
record
,
[
1
,
2
,
3
])
else
:
else
:
...
@@ -921,6 +924,7 @@ class BufferedWriterTest(unittest.TestCase, CommonBufferedTests):
...
@@ -921,6 +924,7 @@ class BufferedWriterTest(unittest.TestCase, CommonBufferedTests):
bufio
=
self
.
tp
(
writer
,
8
)
bufio
=
self
.
tp
(
writer
,
8
)
bufio
.
write
(
b
"abc"
)
bufio
.
write
(
b
"abc"
)
del
bufio
del
bufio
support
.
gc_collect
()
self
.
assertEquals
(
b
"abc"
,
writer
.
_write_stack
[
0
])
self
.
assertEquals
(
b
"abc"
,
writer
.
_write_stack
[
0
])
def
test_truncate
(
self
):
def
test_truncate
(
self
):
...
@@ -1033,7 +1037,7 @@ class CBufferedWriterTest(BufferedWriterTest):
...
@@ -1033,7 +1037,7 @@ class CBufferedWriterTest(BufferedWriterTest):
f
.
x
=
f
f
.
x
=
f
wr
=
weakref
.
ref
(
f
)
wr
=
weakref
.
ref
(
f
)
del
f
del
f
gc
.
collect
()
support
.
gc_
collect
()
self
.
assert_
(
wr
()
is
None
,
wr
)
self
.
assert_
(
wr
()
is
None
,
wr
)
with
open
(
support
.
TESTFN
,
"rb"
)
as
f
:
with
open
(
support
.
TESTFN
,
"rb"
)
as
f
:
self
.
assertEqual
(
f
.
read
(),
b
"123xxx"
)
self
.
assertEqual
(
f
.
read
(),
b
"123xxx"
)
...
@@ -1631,6 +1635,7 @@ class TextIOWrapperTest(unittest.TestCase):
...
@@ -1631,6 +1635,7 @@ class TextIOWrapperTest(unittest.TestCase):
t
=
self
.
TextIOWrapper
(
b
,
encoding
=
"ascii"
)
t
=
self
.
TextIOWrapper
(
b
,
encoding
=
"ascii"
)
t
.
write
(
"abc"
)
t
.
write
(
"abc"
)
del
t
del
t
support
.
gc_collect
()
self
.
assertEquals
([
b
"abc"
],
l
)
self
.
assertEquals
([
b
"abc"
],
l
)
def
test_override_destructor
(
self
):
def
test_override_destructor
(
self
):
...
@@ -1653,6 +1658,7 @@ class TextIOWrapperTest(unittest.TestCase):
...
@@ -1653,6 +1658,7 @@ class TextIOWrapperTest(unittest.TestCase):
b
=
self
.
BytesIO
()
b
=
self
.
BytesIO
()
t
=
MyTextIO
(
b
,
encoding
=
"ascii"
)
t
=
MyTextIO
(
b
,
encoding
=
"ascii"
)
del
t
del
t
support
.
gc_collect
()
self
.
assertEqual
(
record
,
[
1
,
2
,
3
])
self
.
assertEqual
(
record
,
[
1
,
2
,
3
])
def
test_error_through_destructor
(
self
):
def
test_error_through_destructor
(
self
):
...
@@ -1948,7 +1954,7 @@ class CTextIOWrapperTest(TextIOWrapperTest):
...
@@ -1948,7 +1954,7 @@ class CTextIOWrapperTest(TextIOWrapperTest):
t
.
x
=
t
t
.
x
=
t
wr
=
weakref
.
ref
(
t
)
wr
=
weakref
.
ref
(
t
)
del
t
del
t
gc
.
collect
()
support
.
gc_
collect
()
self
.
assert_
(
wr
()
is
None
,
wr
)
self
.
assert_
(
wr
()
is
None
,
wr
)
with
open
(
support
.
TESTFN
,
"rb"
)
as
f
:
with
open
(
support
.
TESTFN
,
"rb"
)
as
f
:
self
.
assertEqual
(
f
.
read
(),
b
"456def"
)
self
.
assertEqual
(
f
.
read
(),
b
"456def"
)
...
@@ -2172,7 +2178,7 @@ class MiscIOTest(unittest.TestCase):
...
@@ -2172,7 +2178,7 @@ class MiscIOTest(unittest.TestCase):
b
.
c
=
c
b
.
c
=
c
wr
=
weakref
.
ref
(
c
)
wr
=
weakref
.
ref
(
c
)
del
c
,
b
del
c
,
b
gc
.
collect
()
support
.
gc_
collect
()
self
.
assert_
(
wr
()
is
None
,
wr
)
self
.
assert_
(
wr
()
is
None
,
wr
)
def
test_abcs
(
self
):
def
test_abcs
(
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