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
19196d43
Commit
19196d43
authored
Mar 20, 2010
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up the manipulation of the warnings filter in test_builtin.
parent
3eb42ad9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
Lib/test/test_builtin.py
Lib/test/test_builtin.py
+5
-8
No files found.
Lib/test/test_builtin.py
View file @
19196d43
...
@@ -2,15 +2,11 @@
...
@@ -2,15 +2,11 @@
import
platform
import
platform
import
unittest
import
unittest
from
test.support
import
fcmp
,
TESTFN
,
unlink
,
run_unittest
from
test.support
import
fcmp
,
TESTFN
,
unlink
,
run_unittest
,
check_warnings
from
operator
import
neg
from
operator
import
neg
import
sys
,
warnings
,
random
,
collections
,
io
import
sys
,
warnings
,
random
,
collections
,
io
warnings
.
filterwarnings
(
"ignore"
,
"hex../oct.. of negative int"
,
FutureWarning
,
__name__
)
warnings
.
filterwarnings
(
"ignore"
,
"integer argument expected"
,
DeprecationWarning
,
"unittest"
)
import
builtins
import
builtins
class
Squares
:
class
Squares
:
...
@@ -427,9 +423,10 @@ class BuiltinTest(unittest.TestCase):
...
@@ -427,9 +423,10 @@ class BuiltinTest(unittest.TestCase):
g
=
{}
g
=
{}
l
=
{}
l
=
{}
import
warnings
with
check_warnings
():
warnings
.
filterwarnings
(
"ignore"
,
"global statement"
,
module
=
"<string>"
)
warnings
.
filterwarnings
(
"ignore"
,
"global statement"
,
exec
(
'global a; a = 1; b = 2'
,
g
,
l
)
module
=
"<string>"
)
exec
(
'global a; a = 1; b = 2'
,
g
,
l
)
if
'__builtins__'
in
g
:
if
'__builtins__'
in
g
:
del
g
[
'__builtins__'
]
del
g
[
'__builtins__'
]
if
'__builtins__'
in
l
:
if
'__builtins__'
in
l
:
...
...
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