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
dfe21074
Kaydet (Commit)
dfe21074
authored
Agu 03, 2010
tarafından
Ezio Melotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix deprecation warnings in test_file.py
üst
cd37dd8e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
test_file.py
Lib/test/test_file.py
+9
-5
No files found.
Lib/test/test_file.py
Dosyayı görüntüle @
dfe21074
...
@@ -34,13 +34,16 @@ class AutoFileTests(unittest.TestCase):
...
@@ -34,13 +34,16 @@ class AutoFileTests(unittest.TestCase):
def
testAttributes
(
self
):
def
testAttributes
(
self
):
# verify expected attributes exist
# verify expected attributes exist
f
=
self
.
f
f
=
self
.
f
softspace
=
f
.
softspace
f
.
name
# merely shouldn't blow up
f
.
name
# merely shouldn't blow up
f
.
mode
# ditto
f
.
mode
# ditto
f
.
closed
# ditto
f
.
closed
# ditto
# verify softspace is writable
with
test_support
.
_check_py3k_warnings
(
f
.
softspace
=
softspace
# merely shouldn't blow up
(
'file.softspace not supported in 3.x'
,
DeprecationWarning
)):
softspace
=
f
.
softspace
# verify softspace is writable
f
.
softspace
=
softspace
# merely shouldn't blow up
# verify the others aren't
# verify the others aren't
for
attr
in
'name'
,
'mode'
,
'closed'
:
for
attr
in
'name'
,
'mode'
,
'closed'
:
...
@@ -111,7 +114,8 @@ class AutoFileTests(unittest.TestCase):
...
@@ -111,7 +114,8 @@ class AutoFileTests(unittest.TestCase):
for
methodname
in
methods
:
for
methodname
in
methods
:
method
=
getattr
(
self
.
f
,
methodname
)
method
=
getattr
(
self
.
f
,
methodname
)
# should raise on closed file
# should raise on closed file
self
.
assertRaises
(
ValueError
,
method
)
with
test_support
.
_check_py3k_warnings
(
quiet
=
True
):
self
.
assertRaises
(
ValueError
,
method
)
self
.
assertRaises
(
ValueError
,
self
.
f
.
writelines
,
[])
self
.
assertRaises
(
ValueError
,
self
.
f
.
writelines
,
[])
# file is closed, __exit__ shouldn't do anything
# file is closed, __exit__ shouldn't do anything
...
@@ -218,7 +222,7 @@ class OtherFileTests(unittest.TestCase):
...
@@ -218,7 +222,7 @@ class OtherFileTests(unittest.TestCase):
try
:
try
:
f
=
open
(
TESTFN
,
bad_mode
)
f
=
open
(
TESTFN
,
bad_mode
)
except
ValueError
,
msg
:
except
ValueError
,
msg
:
if
msg
[
0
]
!=
0
:
if
msg
.
args
[
0
]
!=
0
:
s
=
str
(
msg
)
s
=
str
(
msg
)
if
TESTFN
in
s
or
bad_mode
not
in
s
:
if
TESTFN
in
s
or
bad_mode
not
in
s
:
self
.
fail
(
"bad error message for invalid mode:
%
s"
%
s
)
self
.
fail
(
"bad error message for invalid mode:
%
s"
%
s
)
...
...
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