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
ce7c9781
Kaydet (Commit)
ce7c9781
authored
May 17, 2011
tarafından
Vinay Sajip
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Skip some more tests in the absence of threading.
üst
362ce379
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
14 deletions
+17
-14
test_logging.py
Lib/test/test_logging.py
+17
-14
No files found.
Lib/test/test_logging.py
Dosyayı görüntüle @
ce7c9781
...
...
@@ -25,24 +25,17 @@ import logging
import
logging.handlers
import
logging.config
import
asynchat
import
asyncore
import
codecs
import
datetime
import
errno
import
pickle
import
io
import
gc
from
http.server
import
HTTPServer
,
BaseHTTPRequestHandler
import
json
import
os
import
queue
import
re
import
select
import
smtpd
import
socket
from
socketserver
import
(
ThreadingUDPServer
,
DatagramRequestHandler
,
ThreadingTCPServer
,
StreamRequestHandler
)
import
struct
import
sys
import
tempfile
...
...
@@ -51,11 +44,19 @@ from test.support import TestHandler, Matcher
import
textwrap
import
time
import
unittest
from
urllib.parse
import
urlparse
,
parse_qs
import
warnings
import
weakref
try
:
import
threading
# The following imports are needed only for tests which
import
asynchat
import
asyncore
import
errno
from
http.server
import
HTTPServer
,
BaseHTTPRequestHandler
import
smtpd
from
urllib.parse
import
urlparse
,
parse_qs
from
socketserver
import
(
ThreadingUDPServer
,
DatagramRequestHandler
,
ThreadingTCPServer
,
StreamRequestHandler
)
except
ImportError
:
threading
=
None
try
:
...
...
@@ -611,7 +612,8 @@ class StreamHandlerTest(BaseTest):
# -- The following section could be moved into a server_helper.py module
# -- if it proves to be of wider utility than just test_logging
class
TestSMTPChannel
(
smtpd
.
SMTPChannel
):
if
threading
:
class
TestSMTPChannel
(
smtpd
.
SMTPChannel
):
"""
This derived class has had to be created because smtpd does not
support use of custom channel maps, although they are allowed by
...
...
@@ -644,7 +646,7 @@ class TestSMTPChannel(smtpd.SMTPChannel):
self
.
set_terminator
(
b
'
\r\n
'
)
class
TestSMTPServer
(
smtpd
.
SMTPServer
):
class
TestSMTPServer
(
smtpd
.
SMTPServer
):
"""
This class implements a test SMTP server.
...
...
@@ -744,7 +746,7 @@ class TestSMTPServer(smtpd.SMTPServer):
self
.
_thread
.
join
(
timeout
)
self
.
_thread
=
None
class
ControlMixin
(
object
):
class
ControlMixin
(
object
):
"""
This mixin is used to start a server on a separate thread, and
shut it down programmatically. Request handling is simplified - instead
...
...
@@ -797,7 +799,7 @@ class ControlMixin(object):
self
.
server_close
()
self
.
ready
.
clear
()
class
TestHTTPServer
(
ControlMixin
,
HTTPServer
):
class
TestHTTPServer
(
ControlMixin
,
HTTPServer
):
"""
An HTTP server which is controllable using :class:`ControlMixin`.
...
...
@@ -825,7 +827,7 @@ class TestHTTPServer(ControlMixin, HTTPServer):
HTTPServer
.
__init__
(
self
,
addr
,
DelegatingHTTPRequestHandler
)
ControlMixin
.
__init__
(
self
,
handler
,
poll_interval
)
class
TestTCPServer
(
ControlMixin
,
ThreadingTCPServer
):
class
TestTCPServer
(
ControlMixin
,
ThreadingTCPServer
):
"""
A TCP server which is controllable using :class:`ControlMixin`.
...
...
@@ -856,7 +858,7 @@ class TestTCPServer(ControlMixin, ThreadingTCPServer):
super
(
TestTCPServer
,
self
)
.
server_bind
()
self
.
port
=
self
.
socket
.
getsockname
()[
1
]
class
TestUDPServer
(
ControlMixin
,
ThreadingUDPServer
):
class
TestUDPServer
(
ControlMixin
,
ThreadingUDPServer
):
"""
A UDP server which is controllable using :class:`ControlMixin`.
...
...
@@ -889,6 +891,7 @@ class TestUDPServer(ControlMixin, ThreadingUDPServer):
# - end of server_helper section
@unittest.skipUnless
(
threading
,
'Threading required for this test.'
)
class
SMTPHandlerTest
(
BaseTest
):
def
test_basic
(
self
):
sockmap
=
{}
...
...
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