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
b5792409
Commit
b5792409
authored
Sep 23, 2012
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix some tests to clean up objects
so that they pass on python-dbg
parent
b0cf96a8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
25 deletions
+26
-25
greentest/test__greenlet.py
greentest/test__greenlet.py
+8
-9
greentest/test__order.py
greentest/test__order.py
+14
-15
greentest/test__subprocess_interrupted.py
greentest/test__subprocess_interrupted.py
+4
-1
No files found.
greentest/test__greenlet.py
View file @
b5792409
...
...
@@ -98,12 +98,7 @@ class TestLink(greentest.TestCase):
class
TestUnlink
(
greentest
.
TestCase
):
switch_expected
=
False
def
setUp
(
self
):
greentest
.
TestCase
.
setUp
(
self
)
self
.
p
=
gevent
.
spawn
(
dummy_test_func
)
def
_test_func
(
self
,
link
):
p
=
self
.
p
def
_test_func
(
self
,
p
,
link
):
link
(
dummy_test_func
)
assert
len
(
p
.
_links
)
==
1
,
p
.
_links
p
.
unlink
(
dummy_test_func
)
...
...
@@ -113,15 +108,19 @@ class TestUnlink(greentest.TestCase):
assert
len
(
p
.
_links
)
==
1
,
p
.
_links
p
.
unlink
(
self
.
setUp
)
assert
not
p
.
_links
,
p
.
_links
p
.
kill
()
def
test_func_link
(
self
):
self
.
_test_func
(
self
.
p
.
link
)
p
=
gevent
.
spawn
(
dummy_test_func
)
self
.
_test_func
(
p
,
p
.
link
)
def
test_func_link_value
(
self
):
self
.
_test_func
(
self
.
p
.
link_value
)
p
=
gevent
.
spawn
(
dummy_test_func
)
self
.
_test_func
(
p
,
p
.
link_value
)
def
test_func_link_exception
(
self
):
self
.
_test_func
(
self
.
p
.
link_exception
)
p
=
gevent
.
spawn
(
dummy_test_func
)
self
.
_test_func
(
p
,
p
.
link_exception
)
class
LinksTestCase
(
greentest
.
TestCase
):
...
...
greentest/test__order.py
View file @
b5792409
...
...
@@ -2,31 +2,30 @@ import gevent
import
greentest
class
Test
(
greentest
.
TestCase
):
class
appender
(
object
):
count
=
2
def
__init__
(
self
,
lst
,
item
):
self
.
lst
=
lst
self
.
item
=
item
def
setUp
(
self
):
self
.
lst
=
[]
def
__call__
(
self
,
*
args
):
self
.
lst
.
append
(
self
.
item
)
def
tearDown
(
self
):
self
.
assertEqual
(
self
.
lst
,
range
(
self
.
count
))
def
test_greenlet_link
(
self
):
# test that links are executed in the same order as they were added
g
=
gevent
.
spawn
(
self
.
lst
.
append
,
0
)
class
Test
(
greentest
.
TestCase
):
class
appender
(
object
):
count
=
2
def
__init__
(
myself
,
item
):
myself
.
item
=
item
def
test_greenlet_link
(
self
):
lst
=
[]
def
__call__
(
myself
,
*
args
):
self
.
lst
.
append
(
myself
.
item
)
# test that links are executed in the same order as they were added
g
=
gevent
.
spawn
(
lst
.
append
,
0
)
for
i
in
xrange
(
1
,
self
.
count
):
g
.
link
(
appender
(
i
))
g
.
link
(
appender
(
lst
,
i
))
g
.
join
()
self
.
assertEqual
(
lst
,
range
(
self
.
count
))
class
Test3
(
Test
):
...
...
greentest/test__subprocess_interrupted.py
View file @
b5792409
...
...
@@ -11,4 +11,7 @@ else:
import
subprocess
for
_
in
xrange
(
5
):
out
,
err
=
subprocess
.
Popen
([
sys
.
executable
,
__file__
,
'runtestcase'
],
stderr
=
subprocess
.
PIPE
).
communicate
()
assert
err
.
strip
()
==
'bye'
,
err
if
'refs'
in
err
:
assert
err
.
startswith
(
'bye'
),
repr
(
err
)
else
:
assert
err
.
strip
()
==
'bye'
,
repr
(
err
)
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