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
73c55de3
Commit
73c55de3
authored
Oct 29, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test__greenletset.py: avoid leaking greenlets out of the test case
parent
38360e26
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
greentest/test__greenletset.py
greentest/test__greenletset.py
+9
-0
No files found.
greentest/test__greenletset.py
View file @
73c55de3
...
@@ -6,6 +6,10 @@ from gevent import pool
...
@@ -6,6 +6,10 @@ from gevent import pool
DELAY
=
0.1
DELAY
=
0.1
class
SpecialError
(
Exception
):
pass
class
Undead
(
object
):
class
Undead
(
object
):
def
__init__
(
self
):
def
__init__
(
self
):
...
@@ -15,6 +19,8 @@ class Undead(object):
...
@@ -15,6 +19,8 @@ class Undead(object):
while
True
:
while
True
:
try
:
try
:
gevent
.
sleep
(
1
)
gevent
.
sleep
(
1
)
except
SpecialError
:
break
except
:
except
:
self
.
shot_count
+=
1
self
.
shot_count
+=
1
...
@@ -106,6 +112,9 @@ class Test(greentest.TestCase):
...
@@ -106,6 +112,9 @@ class Test(greentest.TestCase):
assert
len
(
s
)
==
2
,
s
assert
len
(
s
)
==
2
,
s
check
(
1
,
1
)
check
(
1
,
1
)
p1
.
kill
(
SpecialError
)
p2
.
kill
(
SpecialError
)
def
test_killall_subclass
(
self
):
def
test_killall_subclass
(
self
):
p1
=
GreenletSubclass
.
spawn
(
lambda
:
1
/
0
)
p1
=
GreenletSubclass
.
spawn
(
lambda
:
1
/
0
)
p2
=
GreenletSubclass
.
spawn
(
lambda
:
gevent
.
sleep
(
10
))
p2
=
GreenletSubclass
.
spawn
(
lambda
:
gevent
.
sleep
(
10
))
...
...
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