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
a74d675f
Commit
a74d675f
authored
Sep 23, 2008
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
backport the atexit test for r66563
parent
5cd5f12a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
Lib/test/test_atexit.py
Lib/test/test_atexit.py
+13
-0
No files found.
Lib/test/test_atexit.py
View file @
a74d675f
...
...
@@ -22,6 +22,19 @@ class TestCase(unittest.TestCase):
atexit
.
_exithandlers
=
save_handlers
self
.
assertEqual
(
s
.
getvalue
(),
"h4 (4,) {'kw': 'abc'}
\
n
h4 () {}
\
n
h1
\
n
"
)
def
test_badargs
(
self
):
s
=
StringIO
.
StringIO
()
sys
.
stdout
=
sys
.
stderr
=
s
save_handlers
=
atexit
.
_exithandlers
atexit
.
_exithandlers
=
[]
try
:
atexit
.
register
(
lambda
:
1
,
0
,
0
,
(
x
for
x
in
(
1
,
2
)),
0
,
0
)
self
.
assertRaises
(
TypeError
,
atexit
.
_run_exitfuncs
)
finally
:
sys
.
stdout
=
sys
.
__stdout__
sys
.
stderr
=
sys
.
__stderr__
atexit
.
_exithandlers
=
save_handlers
def
test_order
(
self
):
# be sure handlers are executed in reverse order
s
=
StringIO
.
StringIO
()
...
...
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