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
5156101b
Commit
5156101b
authored
Nov 02, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test__api.py: make test cases clean up created objects
parent
28c1985a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
greentest/test__api.py
greentest/test__api.py
+6
-8
No files found.
greentest/test__api.py
View file @
5156101b
...
...
@@ -80,29 +80,27 @@ class Test(greentest.TestCase):
class
TestTimers
(
greentest
.
TestCase
):
def
setUp
(
self
):
greentest
.
TestCase
.
setUp
(
self
)
self
.
lst
=
[
1
]
def
test_timer_fired
(
self
):
lst
=
[
1
]
def
func
():
gevent
.
spawn_later
(
0.01
,
lst
.
pop
)
gevent
.
sleep
(
0.02
)
gevent
.
spawn
(
func
)
assert
self
.
lst
==
[
1
],
self
.
lst
assert
lst
==
[
1
],
lst
gevent
.
sleep
(
0.03
)
assert
self
.
lst
==
[],
self
.
lst
assert
lst
==
[],
lst
def
test_spawn_is_not_cancelled
(
self
):
lst
=
[
1
]
def
func
():
gevent
.
spawn
(
self
.
lst
.
pop
)
gevent
.
spawn
(
lst
.
pop
)
# exiting immediatelly, but self.lst.pop must be called
gevent
.
spawn
(
func
)
gevent
.
sleep
(
0.01
)
assert
self
.
lst
==
[],
self
.
lst
assert
lst
==
[],
lst
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