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
ab9061cb
Commit
ab9061cb
authored
Jan 07, 2012
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test__pool.py: do not create functions inside tests, that confuses refcounter
parent
a4b3d1c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
21 deletions
+18
-21
greentest/test__pool.py
greentest/test__pool.py
+18
-21
No files found.
greentest/test__pool.py
View file @
ab9061cb
...
...
@@ -66,20 +66,10 @@ class TestCoroutinePool(greentest.TestCase):
def
test_reentrant
(
self
):
pool
=
self
.
klass
(
1
)
def
reenter
():
result
=
pool
.
apply
(
lambda
a
:
a
,
(
'reenter'
,
))
self
.
assertEqual
(
'reenter'
,
result
)
pool
.
apply
(
reenter
)
result
=
pool
.
apply
(
pool
.
apply
,
(
lambda
a
:
a
+
1
,
(
5
,
)))
self
.
assertEqual
(
result
,
6
)
evt
=
Event
()
def
reenter_async
():
pool
.
apply_async
(
lambda
a
:
a
,
(
'reenter'
,
))
evt
.
set
()
pool
.
apply_async
(
reenter_async
)
pool
.
apply_async
(
evt
.
set
)
evt
.
wait
()
def
test_stderr_raising
(
self
):
...
...
@@ -347,19 +337,26 @@ class TestSpawn(greentest.TestCase):
self
.
assertEqual
(
len
(
p
),
0
)
def
error_iter
():
yield
1
yield
2
raise
ExpectedException
class
TestErrorInIterator
(
greentest
.
TestCase
):
error_fatal
=
False
def
test
(
self
):
p
=
pool
.
Pool
(
3
)
def
iter
():
yield
1
yield
2
raise
ExpectedException
self
.
assertRaises
(
ExpectedException
,
p
.
map
,
lambda
x
:
None
,
iter
())
def
unordered
(
*
args
):
return
list
(
p
.
imap_unordered
(
*
args
))
self
.
assertRaises
(
ExpectedException
,
unordered
,
lambda
x
:
None
,
iter
())
self
.
assertRaises
(
ExpectedException
,
p
.
map
,
lambda
x
:
None
,
error_iter
())
gevent
.
sleep
(
0.001
)
def
test_unordered
(
self
):
p
=
pool
.
Pool
(
3
)
def
unordered
():
return
list
(
p
.
imap_unordered
(
lambda
x
:
None
,
error_iter
()))
self
.
assertRaises
(
ExpectedException
,
unordered
)
gevent
.
sleep
(
0.001
)
if
__name__
==
'__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