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
5fd7fdcf
Commit
5fd7fdcf
authored
Sep 09, 2009
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test__greenlet.py: add test for join(); use GenericWaitTestCase
parent
72503017
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
17 deletions
+6
-17
greentest/test__greenlet.py
greentest/test__greenlet.py
+6
-17
No files found.
greentest/test__greenlet.py
View file @
5fd7fdcf
...
...
@@ -23,7 +23,6 @@ import sys
import
greentest
import
gevent
import
re
import
time
from
gevent
import
sleep
,
with_timeout
,
getcurrent
from
gevent
import
greenlet
from
gevent.event
import
Event
,
AsyncResult
...
...
@@ -508,25 +507,15 @@ class TestStr(greentest.TestCase):
self
.
assertEqual
(
hexobj
.
sub
(
'X'
,
str
(
g
)),
'<Greenlet at X: <bound method A.method of <__main__.A object at X>>>'
)
class
TestJoin
All
(
greentest
.
TestCase
):
class
TestJoin
(
greentest
.
GenericWait
TestCase
):
def
test_outer_timeout_is_not_lost
(
self
):
t
=
gevent
.
Timeout
.
start_new
(
0.01
)
try
:
gevent
.
joinall
([
gevent
.
spawn
(
gevent
.
sleep
,
10
)],
timeout
=
0.02
)
except
gevent
.
Timeout
,
ex
:
assert
ex
is
t
,
(
ex
,
t
)
else
:
raise
AssertionError
(
'must raise Timeout'
)
gevent
.
sleep
(
0.02
)
def
wait
(
self
,
timeout
):
gevent
.
spawn
(
gevent
.
sleep
,
10
).
join
(
timeout
=
timeout
)
def
test_returns_after_timeout
(
self
):
start
=
time
.
time
()
gevent
.
joinall
([
gevent
.
spawn
(
gevent
.
sleep
,
10
)],
timeout
=
0.01
)
# joinall simply returns after timeout expires
delay
=
time
.
time
()
-
start
assert
0.01
<=
delay
<
0.01
+
0.01
,
delay
class
TestJoinAll
(
greentest
.
GenericWaitTestCase
):
def
wait
(
self
,
timeout
):
gevent
.
joinall
([
gevent
.
spawn
(
gevent
.
sleep
,
10
)],
timeout
=
timeout
)
def
assert_ready
(
g
):
...
...
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