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
b9ee06c2
Kaydet (Commit)
b9ee06c2
authored
Agu 16, 2008
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#3571: try to fix recurrent buildbot failures by strenghtening test_os.test_closerange
üst
a307d0fc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
3 deletions
+20
-3
test_os.py
Lib/test/test_os.py
+20
-3
No files found.
Lib/test/test_os.py
Dosyayı görüntüle @
b9ee06c2
...
...
@@ -21,10 +21,27 @@ class FileTests(unittest.TestCase):
self
.
assert_
(
os
.
access
(
support
.
TESTFN
,
os
.
W_OK
))
def
test_closerange
(
self
):
f
=
os
.
open
(
support
.
TESTFN
,
os
.
O_CREAT
|
os
.
O_RDWR
)
first
=
os
.
open
(
support
.
TESTFN
,
os
.
O_CREAT
|
os
.
O_RDWR
)
# We must allocate two consecutive file descriptors, otherwise
# it will mess up other file descriptors (perhaps even the three
# standard ones).
second
=
os
.
dup
(
first
)
try
:
retries
=
0
while
second
!=
first
+
1
:
os
.
close
(
first
)
retries
+=
1
if
retries
>
10
:
# XXX test skipped
print
(
"couldn't allocate two consecutive fds, "
"skipping test_closerange"
,
file
=
sys
.
stderr
)
return
first
,
second
=
second
,
os
.
dup
(
second
)
finally
:
os
.
close
(
second
)
# close a fd that is open, and one that isn't
os
.
closerange
(
f
,
f
+
2
)
self
.
assertRaises
(
OSError
,
os
.
write
,
f
,
"a"
)
os
.
closerange
(
f
irst
,
first
+
2
)
self
.
assertRaises
(
OSError
,
os
.
write
,
f
irst
,
"a"
)
class
TemporaryFileTests
(
unittest
.
TestCase
):
def
setUp
(
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