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
2e6d2622
Kaydet (Commit)
2e6d2622
authored
Mar 20, 2010
tarafından
Florent Xicluna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#8178 Cleanup the threads after test_thread.TestForkInThread.
üst
b2efeff4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
test_thread.py
Lib/test/test_thread.py
+7
-6
No files found.
Lib/test/test_thread.py
Dosyayı görüntüle @
2e6d2622
...
...
@@ -65,10 +65,10 @@ class ThreadRunningTests(BasicThreadTest):
def
test_stack_size
(
self
):
# Various stack size tests.
self
.
assertEqual
s
(
thread
.
stack_size
(),
0
,
"in
tial stack size is not 0"
)
self
.
assertEqual
(
thread
.
stack_size
(),
0
,
"ini
tial stack size is not 0"
)
thread
.
stack_size
(
0
)
self
.
assertEqual
s
(
thread
.
stack_size
(),
0
,
"stack_size not reset to default"
)
self
.
assertEqual
(
thread
.
stack_size
(),
0
,
"stack_size not reset to default"
)
if
os
.
name
not
in
(
"nt"
,
"os2"
,
"posix"
):
return
...
...
@@ -88,7 +88,7 @@ class ThreadRunningTests(BasicThreadTest):
fail_msg
=
"stack_size(
%
d) failed - should succeed"
for
tss
in
(
262144
,
0x100000
,
0
):
thread
.
stack_size
(
tss
)
self
.
assertEqual
s
(
thread
.
stack_size
(),
tss
,
fail_msg
%
tss
)
self
.
assertEqual
(
thread
.
stack_size
(),
tss
,
fail_msg
%
tss
)
verbose_print
(
"successfully set stack_size(
%
d)"
%
tss
)
for
tss
in
(
262144
,
0x100000
):
...
...
@@ -117,7 +117,7 @@ class ThreadRunningTests(BasicThreadTest):
thread
.
start_new_thread
(
task
,
())
while
not
started
:
time
.
sleep
(
0.01
)
self
.
assertEqual
s
(
thread
.
_count
(),
orig
+
1
)
self
.
assertEqual
(
thread
.
_count
(),
orig
+
1
)
# Allow the task to finish.
mut
.
release
()
# The only reliable way to be sure that the thread ended from the
...
...
@@ -128,7 +128,7 @@ class ThreadRunningTests(BasicThreadTest):
del
task
while
not
done
:
time
.
sleep
(
0.01
)
self
.
assertEqual
s
(
thread
.
_count
(),
orig
)
self
.
assertEqual
(
thread
.
_count
(),
orig
)
class
Barrier
:
...
...
@@ -202,7 +202,8 @@ class TestForkInThread(unittest.TestCase):
self
.
read_fd
,
self
.
write_fd
=
os
.
pipe
()
@unittest.skipIf
(
sys
.
platform
.
startswith
(
'win'
),
"This test is only appropriate for POSIX-like systems."
)
"This test is only appropriate for POSIX-like systems."
)
@test_support.reap_threads
def
test_forkinthread
(
self
):
def
thread1
():
try
:
...
...
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