Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
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
gevent
Commits
a0a1af05
Commit
a0a1af05
authored
Mar 15, 2011
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test__systemerror.py
parent
edfaf987
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
0 deletions
+70
-0
greentest/test__systemerror.py
greentest/test__systemerror.py
+70
-0
No files found.
greentest/test__systemerror.py
0 → 100644
View file @
a0a1af05
import
sys
import
greentest
import
gevent
from
gevent.hub
import
get_hub
def
raise_
(
ex
):
raise
ex
MSG
=
'should be re-raised and caught'
class
Test
(
greentest
.
TestCase
):
def
test_sys_exit
(
self
):
self
.
start
(
sys
.
exit
,
MSG
)
try
:
gevent
.
sleep
(
0.001
)
except
SystemExit
,
ex
:
assert
str
(
ex
)
==
MSG
,
repr
(
str
(
ex
))
def
test_keyboard_interrupt
(
self
):
self
.
start
(
raise_
,
KeyboardInterrupt
)
try
:
gevent
.
sleep
(
0.001
)
except
KeyboardInterrupt
:
pass
def
test_system_error
(
self
):
self
.
start
(
raise_
,
SystemError
(
MSG
))
try
:
gevent
.
sleep
(
0.001
)
except
SystemError
,
ex
:
assert
str
(
ex
)
==
MSG
,
repr
(
str
(
ex
))
def
test_exception
(
self
):
self
.
start
(
raise_
,
Exception
(
'regular exception must not kill the program'
))
gevent
.
sleep
(
0.001
)
class
TestCallback
(
Test
):
def
setUp
(
self
):
super
(
TestCallback
,
self
).
setUp
()
self
.
x
=
get_hub
().
loop
.
callback
()
def
tearDown
(
self
):
assert
not
self
.
x
.
pending
,
self
.
x
def
start
(
self
,
*
args
):
self
.
x
.
start
(
*
args
)
class
TestSpawn
(
Test
):
def
tearDown
(
self
):
assert
self
.
x
.
dead
,
self
.
x
def
start
(
self
,
*
args
):
self
.
x
=
gevent
.
spawn
(
*
args
)
del
Test
if
__name__
==
'__main__'
:
greentest
.
main
()
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