Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
2298d538
Commit
2298d538
authored
Mar 20, 2010
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up warnings filter use in test_global by no longer having it be a
module-level manipulation of the filter.
parent
41a08bcb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
Lib/test/test_global.py
Lib/test/test_global.py
+11
-2
No files found.
Lib/test/test_global.py
View file @
2298d538
"""Verify that warnings are issued for global statements following use."""
from
test.support
import
run_unittest
,
check_syntax_error
from
test.support
import
run_unittest
,
check_syntax_error
,
check_warnings
import
unittest
import
warnings
warnings
.
filterwarnings
(
"error"
,
module
=
"<test string>"
)
class
GlobalTests
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
_warnings_manager
=
check_warnings
()
self
.
_warnings_manager
.
__enter__
()
warnings
.
filterwarnings
(
"error"
,
module
=
"<test string>"
)
def
tearDown
(
self
):
self
.
_warnings_manager
.
__exit__
(
None
,
None
,
None
)
def
test1
(
self
):
prog_text_1
=
"""
\
def wrong1():
...
...
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