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
e94dcf35
Commit
e94dcf35
authored
Nov 02, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
greentest.py: make the wait/get tests sleep less
parent
5da10b9a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
greentest/greentest.py
greentest/greentest.py
+11
-9
No files found.
greentest/greentest.py
View file @
e94dcf35
...
...
@@ -251,14 +251,16 @@ gevent.hub.Hub = CountingHub
def
test_outer_timeout_is_not_lost
(
self
):
timeout
=
gevent
.
Timeout
.
start_new
(
0.01
)
timeout
=
gevent
.
Timeout
.
start_new
(
0.0
0
1
)
try
:
self
.
wait
(
timeout
=
0.02
)
try
:
result
=
self
.
wait
(
timeout
=
1
)
except
gevent
.
Timeout
,
ex
:
assert
ex
is
timeout
,
(
ex
,
timeout
)
else
:
raise
AssertionError
(
'must raise Timeout'
)
gevent
.
sleep
(
0.02
)
raise
AssertionError
(
'must raise Timeout (returned %r)'
%
(
result
,
))
finally
:
timeout
.
cancel
()
class
GenericWaitTestCase
(
TestCase
):
...
...
@@ -270,10 +272,10 @@ class GenericWaitTestCase(TestCase):
def
test_returns_none_after_timeout
(
self
):
start
=
time
.
time
()
result
=
self
.
wait
(
timeout
=
0.01
)
result
=
self
.
wait
(
timeout
=
0.0
0
1
)
# join and wait simply returns after timeout expires
delay
=
time
.
time
()
-
start
assert
0.0
1
-
0.001
<=
delay
<
0.01
+
0.01
+
0.
1
,
delay
assert
0.0
01
-
0.0001
<=
delay
<
0.001
+
0.001
+
0.0
1
,
delay
assert
result
is
None
,
repr
(
result
)
...
...
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