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
00df53bf
Commit
00df53bf
authored
Aug 08, 2010
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable a warningshook test under Python 2.7. No idea how to make that work in both 2.6 and 2.7
parent
b058056d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
17 deletions
+19
-17
src/Zope2/Startup/tests/test_warnfilter.py
src/Zope2/Startup/tests/test_warnfilter.py
+19
-17
No files found.
src/Zope2/Startup/tests/test_warnfilter.py
View file @
00df53bf
...
...
@@ -15,6 +15,7 @@
import
os
import
cStringIO
import
sys
import
tempfile
import
unittest
import
warnings
...
...
@@ -70,23 +71,24 @@ class TestWarnFilter(unittest.TestCase):
self
.
assertEqual
(
conf
.
instancehome
,
TEMPNAME
)
return
conf
,
handler
def
test_behavior
(
self
):
conf
,
handler
=
self
.
load_config_text
(
"""
\
instancehome <<INSTANCE_HOME>>
<warnfilter>
action error
message .*test.*
category Zope2.Startup.tests.test_warnfilter.TestSchemaWarning
module .*test_warnfilter.*
lineno 0
</warnfilter>
<warnfilter>
action error
message .*test.*
</warnfilter>
"""
)
self
.
assertRaises
(
TestSchemaWarning
,
self
.
_dowarning1
)
self
.
assertRaises
(
UserWarning
,
self
.
_dowarning2
)
if
sys
.
version_info
<
(
2
,
7
):
def
test_behavior
(
self
):
conf
,
handler
=
self
.
load_config_text
(
"""
\
instancehome <<INSTANCE_HOME>>
<warnfilter>
action error
message .*test.*
category Zope2.Startup.tests.test_warnfilter.TestSchemaWarning
module .*test_warnfilter.*
lineno 0
</warnfilter>
<warnfilter>
action error
message .*test.*
</warnfilter>
"""
)
self
.
assertRaises
(
TestSchemaWarning
,
self
.
_dowarning1
)
self
.
assertRaises
(
UserWarning
,
self
.
_dowarning2
)
def
_dowarning1
(
self
):
warnings
.
warn
(
'This is only a test.'
,
TestSchemaWarning
)
...
...
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