Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
374a7cf9
Commit
374a7cf9
authored
Dec 19, 2005
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Suppress deprecation output for test of a known-to-be-deprecated feature.
parent
b39a309d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
2 deletions
+35
-2
lib/python/ZServer/datatypes.py
lib/python/ZServer/datatypes.py
+2
-1
lib/python/ZServer/tests/test_config.py
lib/python/ZServer/tests/test_config.py
+33
-1
No files found.
lib/python/ZServer/datatypes.py
View file @
374a7cf9
...
@@ -135,7 +135,8 @@ class FCGIServerFactory(ServerFactory):
...
@@ -135,7 +135,8 @@ class FCGIServerFactory(ServerFactory):
import
warnings
import
warnings
warnings
.
warn
(
"Using FastCGI is deprecated. You should use mod_proxy "
warnings
.
warn
(
"Using FastCGI is deprecated. You should use mod_proxy "
"to run Zope with Apache"
,
DeprecationWarning
)
"to run Zope with Apache"
,
DeprecationWarning
,
stacklevel
=
2
)
import
socket
import
socket
if
section
.
address
.
family
==
socket
.
AF_INET
:
if
section
.
address
.
family
==
socket
.
AF_INET
:
...
...
lib/python/ZServer/tests/test_config.py
View file @
374a7cf9
...
@@ -68,7 +68,38 @@ class BaseTest(unittest.TestCase):
...
@@ -68,7 +68,38 @@ class BaseTest(unittest.TestCase):
self
.
assertEqual
(
factory
.
port
,
9300
+
port
)
self
.
assertEqual
(
factory
.
port
,
9300
+
port
)
class
ZServerConfigurationTestCase
(
BaseTest
):
class
WarningInterceptor
:
_old_stderr
=
None
_our_stderr_stream
=
None
def
_trap_warning_output
(
self
):
if
self
.
_old_stderr
is
not
None
:
return
import
sys
from
StringIO
import
StringIO
self
.
_old_stderr
=
sys
.
stderr
self
.
_our_stderr_stream
=
sys
.
stderr
=
StringIO
()
def
_free_warning_output
(
self
):
if
self
.
_old_stderr
is
None
:
return
import
sys
sys
.
stderr
=
self
.
_old_stderr
class
ZServerConfigurationTestCase
(
BaseTest
,
WarningInterceptor
):
def
setUp
(
self
):
BaseTest
.
setUp
(
self
)
def
tearDown
(
self
):
self
.
_free_warning_output
()
BaseTest
.
tearDown
(
self
)
def
load_unix_domain_factory
(
self
,
text
):
def
load_unix_domain_factory
(
self
,
text
):
fn
=
TEMPFILENAME
fn
=
TEMPFILENAME
...
@@ -147,6 +178,7 @@ class ZServerConfigurationTestCase(BaseTest):
...
@@ -147,6 +178,7 @@ class ZServerConfigurationTestCase(BaseTest):
ZServer
.
datatypes
.
PCGIServerFactory
))
ZServer
.
datatypes
.
PCGIServerFactory
))
def
test_fcgi_factory
(
self
):
def
test_fcgi_factory
(
self
):
self
.
_trap_warning_output
()
factory
=
self
.
load_factory
(
"""
\
factory
=
self
.
load_factory
(
"""
\
<fast-cgi>
<fast-cgi>
address 83
address 83
...
...
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