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
7bfe2666
Commit
7bfe2666
authored
Jul 27, 2009
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test_queue.py: fix to run on 2.4
parent
eebcb623
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
greentest/test_queue.py
greentest/test_queue.py
+8
-8
No files found.
greentest/test_queue.py
View file @
7bfe2666
# Some simple queue module tests, plus some failure conditions
# to ensure the Queue locks remain stable.
from
__future__
import
with_statement
from
gevent
import
queue
as
Queue
#from __future__ import with_statement
from
gevent
import
monkey
;
monkey
.
patch_all
()
from
gevent
import
queue
as
Queue
import
sys
import
threading
import
time
...
...
@@ -51,11 +51,11 @@ class BlockingTestMixin:
self
.
t
.
start
()
self
.
result
=
block_func
(
*
block_args
)
# If block_func returned before our thread made the call, we failed!
if
not
self
.
t
.
startedEvent
.
is
_s
et
():
if
not
self
.
t
.
startedEvent
.
is
S
et
():
self
.
fail
(
"blocking function '%r' appeared not to block"
%
block_func
)
self
.
t
.
join
(
10
)
# make sure the thread terminates
if
self
.
t
.
is
_a
live
():
if
self
.
t
.
is
A
live
():
self
.
fail
(
"trigger function '%r' appeared to not return"
%
trigger_func
)
return
self
.
result
...
...
@@ -75,10 +75,10 @@ class BlockingTestMixin:
expected_exception_class
)
finally
:
self
.
t
.
join
(
10
)
# make sure the thread terminates
if
self
.
t
.
is
_a
live
():
if
self
.
t
.
is
A
live
():
self
.
fail
(
"trigger function '%r' appeared to not return"
%
trigger_func
)
if
not
self
.
t
.
startedEvent
.
is
_s
et
():
if
not
self
.
t
.
startedEvent
.
is
S
et
():
self
.
fail
(
"trigger thread ended but event never set"
)
...
...
@@ -144,8 +144,8 @@ class BaseQueueTest(unittest.TestCase, BlockingTestMixin):
if
x
is
None
:
q
.
task_done
()
return
with
self
.
cumlock
:
self
.
cum
+=
x
#
with self.cumlock:
self
.
cum
+=
x
q
.
task_done
()
def
queue_join_test
(
self
,
q
):
...
...
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