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
e3ab4503
Commit
e3ab4503
authored
Aug 29, 2011
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove test__shutdown.py
parent
31a7a0c9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
49 deletions
+0
-49
greentest/test__shutdown.py
greentest/test__shutdown.py
+0
-49
No files found.
greentest/test__shutdown.py
deleted
100644 → 0
View file @
31a7a0c9
import
unittest
import
time
import
gevent
from
gevent.hub
import
get_hub
class
TestShutdown
(
unittest
.
TestCase
):
def
_shutdown
(
self
,
seconds
=
0
,
fuzzy
=
None
):
if
fuzzy
is
None
:
fuzzy
=
max
(
0.05
,
seconds
/
2.
)
start
=
time
.
time
()
get_hub
().
join
()
delta
=
time
.
time
()
-
start
assert
seconds
-
fuzzy
<
delta
<
seconds
+
fuzzy
,
(
seconds
-
fuzzy
,
delta
,
seconds
+
fuzzy
)
def
assert_hub
(
self
):
assert
'hub'
in
gevent
.
hub
.
_threadlocal
.
__dict__
def
assert_no_hub
(
self
):
assert
'hub'
not
in
gevent
.
hub
.
_threadlocal
.
__dict__
,
gevent
.
hub
.
_threadlocal
.
__dict__
def
test
(
self
):
# make sure Hub is started. For the test case when hub is not started, see test_hub_shutdown.py
gevent
.
sleep
(
0
)
assert
not
gevent
.
hub
.
get_hub
().
dead
self
.
_shutdown
()
self
.
assert_no_hub
()
# shutting down dead hub is silent
self
.
_shutdown
()
self
.
_shutdown
()
self
.
assert_no_hub
()
# ressurect
gevent
.
sleep
(
0
)
self
.
assert_hub
()
t
=
get_hub
().
loop
.
timer
(
0.1
)
t
.
start
(
lambda
:
None
)
self
.
assert_hub
()
self
.
_shutdown
(
seconds
=
0.1
)
self
.
assert_no_hub
()
self
.
_shutdown
(
seconds
=
0
)
self
.
assert_no_hub
()
if
__name__
==
'__main__'
:
unittest
.
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