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
2496f331
Kaydet (Commit)
2496f331
authored
Eyl 19, 2011
tarafından
Nick Coghlan
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Close issue 12958 by flagging expected failures in test_socket on Mac OS X
üst
b1e5d595
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
2 deletions
+34
-2
test.rst
Doc/library/test.rst
+9
-2
support.py
Lib/test/support.py
+12
-0
test_socket.py
Lib/test/test_socket.py
+13
-0
No files found.
Doc/library/test.rst
Dosyayı görüntüle @
2496f331
...
...
@@ -399,12 +399,19 @@ The :mod:`test.support` module defines the following functions:
otherwise.
..
function
:: skip_unless_symlink()
..
decorator
:: skip_unless_symlink()
A decorator for running tests that require support for symbolic links.
.. function:: run_with_locale(catstr, *locales)
.. decorator:: anticipate_failure(condition)
A decorator to conditionally mark tests with
:func:`unittest.expectedFailure`. Any use of this decorator should
have an associated comment identifying the relevant tracker issue.
.. decorator:: run_with_locale(catstr, *locales)
A decorator for running a function in a different locale, correctly
resetting it after it has finished. *catstr* is the locale category as
...
...
Lib/test/support.py
Dosyayı görüntüle @
2496f331
...
...
@@ -57,6 +57,7 @@ __all__ = [
"get_attribute"
,
"swap_item"
,
"swap_attr"
,
"requires_IEEE_754"
,
"TestHandler"
,
"Matcher"
,
"can_symlink"
,
"skip_unless_symlink"
,
"import_fresh_module"
,
"requires_zlib"
,
"PIPE_MAX_SIZE"
,
"failfast"
,
"anticipate_failure"
]
class
Error
(
Exception
):
...
...
@@ -127,6 +128,17 @@ def _save_and_block_module(name, orig_modules):
return
saved
def
anticipate_failure
(
condition
):
"""Decorator to mark a test that is known to be broken in some cases
Any use of this decorator should have a comment identifying the
associated tracker issue.
"""
if
condition
:
return
unittest
.
expectedFailure
return
lambda
f
:
f
def
import_fresh_module
(
name
,
fresh
=
(),
blocked
=
(),
deprecated
=
False
):
"""Imports and returns a module, deliberately bypassing the sys.modules cache
and importing a fresh copy of the module. Once the import is complete,
...
...
Lib/test/test_socket.py
Dosyayı görüntüle @
2496f331
...
...
@@ -167,6 +167,9 @@ class ThreadableTest:
raise
TypeError
(
"test_func must be a callable function"
)
try
:
test_func
()
except
unittest
.
_ExpectedFailure
:
# We deliberately ignore expected failures
pass
except
BaseException
as
e
:
self
.
queue
.
put
(
e
)
finally
:
...
...
@@ -2090,6 +2093,8 @@ class SCMRightsTest(SendrecvmsgServerTimeoutBase):
def
_testFDPassCMSG_LEN
(
self
):
self
.
createAndSendFDs
(
1
)
# Issue #12958: The following test has problems on Mac OS X
@support.anticipate_failure
(
sys
.
platform
==
"darwin"
)
@requireAttrs
(
socket
,
"CMSG_SPACE"
)
def
testFDPassSeparate
(
self
):
# Pass two FDs in two separate arrays. Arrays may be combined
...
...
@@ -2099,6 +2104,7 @@ class SCMRightsTest(SendrecvmsgServerTimeoutBase):
maxcmsgs
=
2
)
@testFDPassSeparate.client_skip
@support.anticipate_failure
(
sys
.
platform
==
"darwin"
)
def
_testFDPassSeparate
(
self
):
fd0
,
fd1
=
self
.
newFDs
(
2
)
self
.
assertEqual
(
...
...
@@ -2110,6 +2116,8 @@ class SCMRightsTest(SendrecvmsgServerTimeoutBase):
array
.
array
(
"i"
,
[
fd1
]))]),
len
(
MSG
))
# Issue #12958: The following test has problems on Mac OS X
@support.anticipate_failure
(
sys
.
platform
==
"darwin"
)
@requireAttrs
(
socket
,
"CMSG_SPACE"
)
def
testFDPassSeparateMinSpace
(
self
):
# Pass two FDs in two separate arrays, receiving them into the
...
...
@@ -2121,6 +2129,7 @@ class SCMRightsTest(SendrecvmsgServerTimeoutBase):
maxcmsgs
=
2
,
ignoreflags
=
socket
.
MSG_CTRUNC
)
@testFDPassSeparateMinSpace.client_skip
@support.anticipate_failure
(
sys
.
platform
==
"darwin"
)
def
_testFDPassSeparateMinSpace
(
self
):
fd0
,
fd1
=
self
.
newFDs
(
2
)
self
.
assertEqual
(
...
...
@@ -3024,9 +3033,12 @@ class InterruptedSendTimeoutTest(InterruptedTimeoutBase,
self
.
assertNotIsInstance
(
cm
.
exception
,
socket
.
timeout
)
self
.
assertEqual
(
cm
.
exception
.
errno
,
errno
.
EINTR
)
# Issue #12958: The following tests have problems on Mac OS X
@support.anticipate_failure
(
sys
.
platform
==
"darwin"
)
def
testInterruptedSendTimeout
(
self
):
self
.
checkInterruptedSend
(
self
.
serv_conn
.
send
,
b
"a"
*
512
)
@support.anticipate_failure
(
sys
.
platform
==
"darwin"
)
def
testInterruptedSendtoTimeout
(
self
):
# Passing an actual address here as Python's wrapper for
# sendto() doesn't allow passing a zero-length one; POSIX
...
...
@@ -3035,6 +3047,7 @@ class InterruptedSendTimeoutTest(InterruptedTimeoutBase,
self
.
checkInterruptedSend
(
self
.
serv_conn
.
sendto
,
b
"a"
*
512
,
self
.
serv_addr
)
@support.anticipate_failure
(
sys
.
platform
==
"darwin"
)
@requireAttrs
(
socket
.
socket
,
"sendmsg"
)
def
testInterruptedSendmsgTimeout
(
self
):
self
.
checkInterruptedSend
(
self
.
serv_conn
.
sendmsg
,
[
b
"a"
*
512
])
...
...
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