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
12e5e751
Commit
12e5e751
authored
Dec 22, 2017
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some tests.
parent
8eb62985
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
9 deletions
+11
-9
src/gevent/libuv/watcher.py
src/gevent/libuv/watcher.py
+6
-5
src/greentest/test__core.py
src/greentest/test__core.py
+2
-1
src/greentest/test__core_watcher.py
src/greentest/test__core_watcher.py
+3
-3
No files found.
src/gevent/libuv/watcher.py
View file @
12e5e751
...
...
@@ -340,9 +340,9 @@ class io(_base.IoMixin, watcher):
# has also gone away.
self
.
_watcher_ref
=
watcher
@
property
def
events
(
self
):
return
self
.
_events
events
=
property
(
lambda
self
:
self
.
_events
,
_base
.
not_while_active
(
lambda
self
,
nv
:
setattr
(
self
,
'_events'
,
nv
)))
def
start
(
self
,
callback
,
*
args
,
**
kwargs
):
_dbg
(
"Starting IO multiplex watcher for"
,
self
.
fd
,
...
...
@@ -364,7 +364,8 @@ class io(_base.IoMixin, watcher):
self
.
pass_events
=
None
self
.
args
=
None
watcher
=
self
.
_watcher_ref
watcher
.
_io_maybe_stop
()
if
watcher
is
not
None
:
watcher
.
_io_maybe_stop
()
def
close
(
self
):
if
self
.
_watcher_ref
is
not
None
:
...
...
@@ -382,7 +383,7 @@ class io(_base.IoMixin, watcher):
# ares.pyx depends on this property,
# and test__core uses it too
fd
=
property
(
lambda
self
:
self
.
_watcher_ref
.
_fd
,
fd
=
property
(
lambda
self
:
getattr
(
self
.
_watcher_ref
,
'_fd'
,
-
1
)
,
lambda
self
,
nv
:
self
.
_watcher_ref
.
_set_fd
(
nv
))
def
_io_maybe_stop
(
self
):
...
...
src/greentest/test__core.py
View file @
12e5e751
...
...
@@ -22,7 +22,7 @@ class TestWatchers(unittest.TestCase):
def
test_io
(
self
):
if
sys
.
platform
==
'win32'
:
# libev raises IOError, libuv raises ValueError
Error
=
(
IOError
,
ValueError
)
Error
=
(
IOError
,
ValueError
)
win32
=
True
else
:
Error
=
ValueError
...
...
@@ -47,6 +47,7 @@ class TestWatchers(unittest.TestCase):
self
.
assertEqual
(
core
.
_events_to_str
(
io
.
events
),
'WRITE|_IOFDSET'
)
else
:
self
.
assertEqual
(
core
.
_events_to_str
(
io
.
events
),
'WRITE'
)
io
.
close
()
def
test_timer_constructor
(
self
):
with
self
.
assertRaises
(
ValueError
):
...
...
src/greentest/test__core_watcher.py
View file @
12e5e751
...
...
@@ -73,10 +73,10 @@ class Test(greentest.TestCase):
loop
=
core
.
loop
(
default
=
False
)
# Watchers aren't reused once all outstanding
# refs go away
# refs go away
BUT THEY MUST BE CLOSED
tty_watcher
=
loop
.
io
(
1
,
core
.
WRITE
)
watcher_handle
=
tty_watcher
.
_watcher
if
IS_CFFI
else
tty_watcher
tty_watcher
.
close
()
del
tty_watcher
# XXX: Note there is a cycle in the CFFI code
# from watcher_handle._handle -> watcher_handle.
...
...
@@ -86,7 +86,7 @@ class Test(greentest.TestCase):
tty_watcher
=
loop
.
io
(
1
,
core
.
WRITE
)
self
.
assertIsNot
(
tty_watcher
.
_watcher
if
IS_CFFI
else
tty_watcher
,
watcher_handle
)
tty_watcher
.
close
()
loop
.
destroy
()
def
reset
(
watcher
,
lst
):
...
...
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