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
653238a8
Kaydet (Commit)
653238a8
authored
Eki 30, 2010
tarafından
Brett Cannon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Silence some ResourceWarning in test_mailbox by using file context managers.
Also call super().tearDown() where appropriate.
üst
d05f9ad3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
test_mailbox.py
Lib/test/test_mailbox.py
+6
-2
No files found.
Lib/test/test_mailbox.py
Dosyayı görüntüle @
653238a8
...
...
@@ -165,8 +165,10 @@ class TestMailbox(TestBase):
# Get file representations of messages
key0
=
self
.
_box
.
add
(
self
.
_template
%
0
)
key1
=
self
.
_box
.
add
(
_sample_message
)
data0
=
self
.
_box
.
get_file
(
key0
)
.
read
()
data1
=
self
.
_box
.
get_file
(
key1
)
.
read
()
with
self
.
_box
.
get_file
(
key0
)
as
file
:
data0
=
file
.
read
()
with
self
.
_box
.
get_file
(
key1
)
as
file
:
data1
=
file
.
read
()
self
.
assertEqual
(
data0
.
replace
(
os
.
linesep
,
'
\n
'
),
self
.
_template
%
0
)
self
.
assertEqual
(
data1
.
replace
(
os
.
linesep
,
'
\n
'
),
...
...
@@ -773,6 +775,7 @@ class TestMaildir(TestMailbox):
class
_TestMboxMMDF
(
TestMailbox
):
def
tearDown
(
self
):
super
()
.
tearDown
()
self
.
_box
.
close
()
self
.
_delete_recursively
(
self
.
_path
)
for
lock_remnant
in
glob
.
glob
(
self
.
_path
+
'.*'
):
...
...
@@ -1027,6 +1030,7 @@ class TestBabyl(TestMailbox):
_factory
=
lambda
self
,
path
,
factory
=
None
:
mailbox
.
Babyl
(
path
,
factory
)
def
tearDown
(
self
):
super
()
.
tearDown
()
self
.
_box
.
close
()
self
.
_delete_recursively
(
self
.
_path
)
for
lock_remnant
in
glob
.
glob
(
self
.
_path
+
'.*'
):
...
...
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