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
91081508
Commit
91081508
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
6d23d8ff
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
3 deletions
+36
-3
lib/python/ZServer/datatypes.py
lib/python/ZServer/datatypes.py
+3
-2
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 @
91081508
...
...
@@ -134,8 +134,9 @@ class FCGIServerFactory(ServerFactory):
def
__init__
(
self
,
section
):
import
warnings
warnings
.
warn
(
"Using FastCGI is deprecated. You should use mod_proxy "
+
"to run Zope with Apache"
,
DeprecationWarning
)
warnings
.
warn
(
"Using FastCGI is deprecated. You should use mod_proxy "
"to run Zope with Apache"
,
DeprecationWarning
,
stacklevel
=
2
)
import
socket
...
...
lib/python/ZServer/tests/test_config.py
View file @
91081508
...
...
@@ -68,7 +68,38 @@ class BaseTest(unittest.TestCase):
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
):
fn
=
TEMPFILENAME
...
...
@@ -147,6 +178,7 @@ class ZServerConfigurationTestCase(BaseTest):
ZServer
.
datatypes
.
PCGIServerFactory
))
def
test_fcgi_factory
(
self
):
self
.
_trap_warning_output
()
factory
=
self
.
load_factory
(
"""
\
<fast-cgi>
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