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
62b6a0d7
Kaydet (Commit)
62b6a0d7
authored
Mar 15, 2016
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #26523: The multiprocessing thread pool (multiprocessing.dummy.Pool) was untested.
üst
ecd53838
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
9 deletions
+19
-9
_test_multiprocessing.py
Lib/test/_test_multiprocessing.py
+16
-9
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/_test_multiprocessing.py
Dosyayı görüntüle @
62b6a0d7
...
@@ -1818,13 +1818,19 @@ class _TestPool(BaseTestCase):
...
@@ -1818,13 +1818,19 @@ class _TestPool(BaseTestCase):
expected_values
.
remove
(
value
)
expected_values
.
remove
(
value
)
def
test_make_pool
(
self
):
def
test_make_pool
(
self
):
self
.
assertRaises
(
ValueError
,
multiprocessing
.
Pool
,
-
1
)
expected_error
=
(
RemoteError
if
self
.
TYPE
==
'manager'
self
.
assertRaises
(
ValueError
,
multiprocessing
.
Pool
,
0
)
else
ValueError
)
p
=
multiprocessing
.
Pool
(
3
)
self
.
assertRaises
(
expected_error
,
self
.
Pool
,
-
1
)
self
.
assertEqual
(
3
,
len
(
p
.
_pool
))
self
.
assertRaises
(
expected_error
,
self
.
Pool
,
0
)
p
.
close
()
p
.
join
()
if
self
.
TYPE
!=
'manager'
:
p
=
self
.
Pool
(
3
)
try
:
self
.
assertEqual
(
3
,
len
(
p
.
_pool
))
finally
:
p
.
close
()
p
.
join
()
def
test_terminate
(
self
):
def
test_terminate
(
self
):
result
=
self
.
pool
.
map_async
(
result
=
self
.
pool
.
map_async
(
...
@@ -1833,7 +1839,8 @@ class _TestPool(BaseTestCase):
...
@@ -1833,7 +1839,8 @@ class _TestPool(BaseTestCase):
self
.
pool
.
terminate
()
self
.
pool
.
terminate
()
join
=
TimingWrapper
(
self
.
pool
.
join
)
join
=
TimingWrapper
(
self
.
pool
.
join
)
join
()
join
()
self
.
assertLess
(
join
.
elapsed
,
0.5
)
# Sanity check the pool didn't wait for all tasks to finish
self
.
assertLess
(
join
.
elapsed
,
2.0
)
def
test_empty_iterable
(
self
):
def
test_empty_iterable
(
self
):
# See Issue 12157
# See Issue 12157
...
@@ -1851,7 +1858,7 @@ class _TestPool(BaseTestCase):
...
@@ -1851,7 +1858,7 @@ class _TestPool(BaseTestCase):
if
self
.
TYPE
==
'processes'
:
if
self
.
TYPE
==
'processes'
:
L
=
list
(
range
(
10
))
L
=
list
(
range
(
10
))
expected
=
[
sqr
(
i
)
for
i
in
L
]
expected
=
[
sqr
(
i
)
for
i
in
L
]
with
multiprocessing
.
Pool
(
2
)
as
p
:
with
self
.
Pool
(
2
)
as
p
:
r
=
p
.
map_async
(
sqr
,
L
)
r
=
p
.
map_async
(
sqr
,
L
)
self
.
assertEqual
(
r
.
get
(),
expected
)
self
.
assertEqual
(
r
.
get
(),
expected
)
self
.
assertRaises
(
ValueError
,
p
.
map_async
,
sqr
,
L
)
self
.
assertRaises
(
ValueError
,
p
.
map_async
,
sqr
,
L
)
...
@@ -3834,7 +3841,7 @@ class ThreadsMixin(object):
...
@@ -3834,7 +3841,7 @@ class ThreadsMixin(object):
connection
=
multiprocessing
.
dummy
.
connection
connection
=
multiprocessing
.
dummy
.
connection
current_process
=
staticmethod
(
multiprocessing
.
dummy
.
current_process
)
current_process
=
staticmethod
(
multiprocessing
.
dummy
.
current_process
)
active_children
=
staticmethod
(
multiprocessing
.
dummy
.
active_children
)
active_children
=
staticmethod
(
multiprocessing
.
dummy
.
active_children
)
Pool
=
staticmethod
(
multiprocessing
.
Pool
)
Pool
=
staticmethod
(
multiprocessing
.
dummy
.
Pool
)
Pipe
=
staticmethod
(
multiprocessing
.
dummy
.
Pipe
)
Pipe
=
staticmethod
(
multiprocessing
.
dummy
.
Pipe
)
Queue
=
staticmethod
(
multiprocessing
.
dummy
.
Queue
)
Queue
=
staticmethod
(
multiprocessing
.
dummy
.
Queue
)
JoinableQueue
=
staticmethod
(
multiprocessing
.
dummy
.
JoinableQueue
)
JoinableQueue
=
staticmethod
(
multiprocessing
.
dummy
.
JoinableQueue
)
...
...
Misc/NEWS
Dosyayı görüntüle @
62b6a0d7
...
@@ -298,6 +298,9 @@ Documentation
...
@@ -298,6 +298,9 @@ Documentation
Tests
Tests
-----
-----
-
Issue
#
26523
:
The
multiprocessing
thread
pool
(
multiprocessing
.
dummy
.
Pool
)
was
untested
.
-
Issue
#
26015
:
Added
new
tests
for
pickling
iterators
of
mutable
sequences
.
-
Issue
#
26015
:
Added
new
tests
for
pickling
iterators
of
mutable
sequences
.
-
Issue
#
26325
:
Added
test
.
support
.
check_no_resource_warning
()
to
check
that
-
Issue
#
26325
:
Added
test
.
support
.
check_no_resource_warning
()
to
check
that
...
...
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