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
31a7a0c9
Commit
31a7a0c9
authored
Aug 29, 2011
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test_hub_join_timeout.py: add testcase for passing Event()
parent
7ce0b531
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
greentest/test_hub_join_timeout.py
greentest/test_hub_join_timeout.py
+17
-0
No files found.
greentest/test_hub_join_timeout.py
View file @
31a7a0c9
from
__future__
import
with_statement
from
contextlib
import
contextmanager
import
gevent
from
gevent.event
import
Event
from
time
import
time
...
...
@@ -56,6 +57,22 @@ for _a in xrange(2):
result
=
gevent
.
get_hub
().
join
()
assert
result
is
True
# exiting because of event (the spawned greenlet still runs)
for
_
in
xrange
(
2
):
x
=
gevent
.
spawn_later
(
10
,
lambda
:
5
)
event
=
Event
()
event_set
=
gevent
.
spawn_later
(
SMALL
,
event
.
set
)
with
expected_time
(
SMALL
):
result
=
gevent
.
get_hub
().
join
(
event
=
event
)
assert
result
is
None
,
repr
(
result
)
assert
not
x
.
dead
,
x
assert
event_set
.
dead
assert
event
.
is_set
()
x
.
kill
()
with
no_time
():
result
=
gevent
.
get_hub
().
join
()
assert
result
is
True
# checking "ref=False" argument
for
_
in
xrange
(
2
):
gevent
.
get_hub
().
loop
.
timer
(
10
,
ref
=
False
).
start
(
lambda
:
None
)
...
...
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