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
cf8bd97d
Commit
cf8bd97d
authored
Jul 26, 2012
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a few more tests
parent
854d31b9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
0 deletions
+57
-0
greentest/test__GreenletExit.py
greentest/test__GreenletExit.py
+4
-0
greentest/test__core_async.py
greentest/test__core_async.py
+18
-0
greentest/test__environ.py
greentest/test__environ.py
+12
-0
greentest/test__joinall.py
greentest/test__joinall.py
+11
-0
greentest/test__loop_callback.py
greentest/test__loop_callback.py
+12
-0
No files found.
greentest/test__GreenletExit.py
0 → 100644
View file @
cf8bd97d
from
gevent
import
GreenletExit
assert
issubclass
(
GreenletExit
,
BaseException
)
assert
not
issubclass
(
GreenletExit
,
Exception
)
greentest/test__core_async.py
0 → 100644
View file @
cf8bd97d
from
__future__
import
with_statement
import
gevent
import
gevent.core
import
time
import
thread
hub
=
gevent
.
get_hub
()
watcher
=
hub
.
loop
.
async
()
gevent
.
spawn_later
(
0.1
,
thread
.
start_new_thread
,
watcher
.
send
,
())
start
=
time
.
time
()
with
gevent
.
Timeout
(
0.3
):
hub
.
wait
(
watcher
)
print
'Watcher %r reacted after %.6f seconds'
%
(
watcher
,
time
.
time
()
-
start
-
0.1
)
greentest/test__environ.py
0 → 100644
View file @
cf8bd97d
import
os
import
sys
import
gevent
import
subprocess
if
sys
.
argv
[
1
:]
==
[]:
os
.
environ
[
'GEVENT_BACKEND'
]
=
'select'
popen
=
subprocess
.
Popen
([
sys
.
executable
,
'test__environ.py'
,
'1'
])
assert
popen
.
wait
()
==
0
,
popen
.
poll
()
else
:
hub
=
gevent
.
get_hub
()
assert
hub
.
loop
.
backend
==
'select'
,
hub
.
loop
.
backend
greentest/test__joinall.py
0 → 100644
View file @
cf8bd97d
import
gevent
def
func
():
pass
a
=
gevent
.
spawn
(
func
)
b
=
gevent
.
spawn
(
func
)
gevent
.
joinall
([
a
,
b
,
a
])
greentest/test__loop_callback.py
0 → 100644
View file @
cf8bd97d
from
gevent.core
import
loop
count
=
0
def
incr
():
global
count
count
+=
1
loop
=
loop
()
loop
.
callback
().
start
(
incr
)
loop
.
run
()
assert
count
==
1
,
count
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