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
d178e69a
Kaydet (Commit)
d178e69a
authored
Kas 15, 2016
tarafından
Xavier de Gaye
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue 28668: Merge 3.5
üst
f9cca365
49e8f2d2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
__init__.py
Lib/test/support/__init__.py
+17
-1
test_logging.py
Lib/test/test_logging.py
+2
-0
No files found.
Lib/test/support/__init__.py
Dosyayı görüntüle @
d178e69a
...
@@ -90,7 +90,7 @@ __all__ = [
...
@@ -90,7 +90,7 @@ __all__ = [
"bigmemtest"
,
"bigaddrspacetest"
,
"cpython_only"
,
"get_attribute"
,
"bigmemtest"
,
"bigaddrspacetest"
,
"cpython_only"
,
"get_attribute"
,
"requires_IEEE_754"
,
"skip_unless_xattr"
,
"requires_zlib"
,
"requires_IEEE_754"
,
"skip_unless_xattr"
,
"requires_zlib"
,
"anticipate_failure"
,
"load_package_tests"
,
"detect_api_mismatch"
,
"anticipate_failure"
,
"load_package_tests"
,
"detect_api_mismatch"
,
"check__all__"
,
"requires_android_level"
,
"check__all__"
,
"requires_android_level"
,
"requires_multiprocessing_queue"
,
# sys
# sys
"is_jython"
,
"is_android"
,
"check_impl_detail"
,
"unix_shell"
,
"is_jython"
,
"is_android"
,
"check_impl_detail"
,
"unix_shell"
,
# network
# network
...
@@ -1752,6 +1752,22 @@ def impl_detail(msg=None, **guards):
...
@@ -1752,6 +1752,22 @@ def impl_detail(msg=None, **guards):
msg
=
msg
.
format
(
' or '
.
join
(
guardnames
))
msg
=
msg
.
format
(
' or '
.
join
(
guardnames
))
return
unittest
.
skip
(
msg
)
return
unittest
.
skip
(
msg
)
_have_mp_queue
=
None
def
requires_multiprocessing_queue
(
test
):
"""Skip decorator for tests that use multiprocessing.Queue."""
global
_have_mp_queue
if
_have_mp_queue
is
None
:
import
multiprocessing
# Without a functioning shared semaphore implementation attempts to
# instantiate a Queue will result in an ImportError (issue #3770).
try
:
multiprocessing
.
Queue
()
_have_mp_queue
=
True
except
ImportError
:
_have_mp_queue
=
False
msg
=
"requires a functioning shared semaphore implementation"
return
test
if
_have_mp_queue
else
unittest
.
skip
(
msg
)(
test
)
def
_parse_guards
(
guards
):
def
_parse_guards
(
guards
):
# Returns a tuple ({platform_name: run_me}, default_value)
# Returns a tuple ({platform_name: run_me}, default_value)
if
not
guards
:
if
not
guards
:
...
...
Lib/test/test_logging.py
Dosyayı görüntüle @
d178e69a
...
@@ -3124,6 +3124,7 @@ if hasattr(logging.handlers, 'QueueListener'):
...
@@ -3124,6 +3124,7 @@ if hasattr(logging.handlers, 'QueueListener'):
self
.
assertEqual
(
mock_handle
.
call_count
,
5
*
self
.
repeat
,
self
.
assertEqual
(
mock_handle
.
call_count
,
5
*
self
.
repeat
,
'correct number of handled log messages'
)
'correct number of handled log messages'
)
@support.requires_multiprocessing_queue
@patch.object
(
logging
.
handlers
.
QueueListener
,
'handle'
)
@patch.object
(
logging
.
handlers
.
QueueListener
,
'handle'
)
def
test_handle_called_with_mp_queue
(
self
,
mock_handle
):
def
test_handle_called_with_mp_queue
(
self
,
mock_handle
):
for
i
in
range
(
self
.
repeat
):
for
i
in
range
(
self
.
repeat
):
...
@@ -3140,6 +3141,7 @@ if hasattr(logging.handlers, 'QueueListener'):
...
@@ -3140,6 +3141,7 @@ if hasattr(logging.handlers, 'QueueListener'):
except
queue
.
Empty
:
except
queue
.
Empty
:
return
[]
return
[]
@support.requires_multiprocessing_queue
def
test_no_messages_in_queue_after_stop
(
self
):
def
test_no_messages_in_queue_after_stop
(
self
):
"""
"""
Five messages are logged then the QueueListener is stopped. This
Five messages are logged then the QueueListener is stopped. This
...
...
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