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
66a4e12d
Kaydet (Commit)
66a4e12d
authored
Mar 25, 2011
tarafından
R David Murray
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge #9557: eliminate 3 seconds of static overhead from test_mailbox.
üst
df07aace
b9a428d5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
test_mailbox.py
Lib/test/test_mailbox.py
+11
-7
No files found.
Lib/test/test_mailbox.py
Dosyayı görüntüle @
66a4e12d
...
...
@@ -869,8 +869,6 @@ class TestMaildir(TestMailbox):
self
.
assertFalse
((
perms
&
0
o111
))
# Execute bits should all be off.
def
test_reread
(
self
):
# Wait for 2 seconds
time
.
sleep
(
2
)
# Initially, the mailbox has not been read and the time is null.
assert
getattr
(
self
.
_box
,
'_last_read'
,
None
)
is
None
...
...
@@ -879,15 +877,21 @@ class TestMaildir(TestMailbox):
self
.
_box
.
_refresh
()
assert
getattr
(
self
.
_box
,
'_last_read'
,
None
)
is
not
None
# Try calling _refresh() again; the modification times shouldn't have
# changed, so the mailbox should not be re-reading. Re-reading causes
# the ._toc attribute to be assigned a new dictionary object, so
# we'll check that the ._toc attribute isn't a different object.
# Put the last modified times more than one second into the past
# (because mtime has a one second granularity, a refresh is done
# unconditionally if called for within the same second, just in case
# the mbox has changed).
for
subdir
in
(
'cur'
,
'new'
):
os
.
utime
(
os
.
path
.
join
(
self
.
_box
.
_path
,
subdir
),
(
time
.
time
()
-
5
,)
*
2
)
# Re-reading causes the ._toc attribute to be assigned a new dictionary
# object, so we'll check that the ._toc attribute isn't a different
# object.
orig_toc
=
self
.
_box
.
_toc
def
refreshed
():
return
self
.
_box
.
_toc
is
not
orig_toc
time
.
sleep
(
1
)
# Wait 1sec to ensure time.time()'s value changes
self
.
_box
.
_refresh
()
assert
not
refreshed
()
...
...
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