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
b3a82cb2
Commit
b3a82cb2
authored
Oct 26, 2016
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always teardown the connection. Seeing strange timeouts on appveyor.
parent
50dc757f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
14 deletions
+17
-14
src/greentest/test__backdoor.py
src/greentest/test__backdoor.py
+17
-14
No files found.
src/greentest/test__backdoor.py
View file @
b3a82cb2
...
...
@@ -41,18 +41,22 @@ class Test(greentest.TestCase):
conn
.
connect
((
'127.0.0.1'
,
self
.
_server
.
server_port
))
return
conn
def
_close
(
self
,
conn
):
conn
.
sendall
(
b'quit()
\
r
\
n
'
)
line
=
readline
(
conn
)
self
.
assertEqual
(
line
,
''
)
conn
.
close
()
def
test
(
self
):
self
.
_make_server
()
def
connect
():
conn
=
self
.
_create_connection
()
try
:
read_until
(
conn
,
'>>> '
)
conn
.
sendall
(
b'2+2
\
r
\
n
'
)
line
=
readline
(
conn
)
self
.
assertEqual
(
line
.
strip
(),
'4'
,
repr
(
line
))
finally
:
conn
.
close
()
read_until
(
conn
,
'>>> '
)
conn
.
sendall
(
b'2+2
\
r
\
n
'
)
line
=
readline
(
conn
)
self
.
assertEqual
(
line
.
strip
(),
'4'
,
repr
(
line
))
self
.
_close
(
conn
)
jobs
=
[
gevent
.
spawn
(
connect
)
for
_
in
xrange
(
10
)]
gevent
.
joinall
(
jobs
,
raise_error
=
True
)
...
...
@@ -61,9 +65,7 @@ class Test(greentest.TestCase):
self
.
_make_server
()
conn
=
self
.
_create_connection
()
read_until
(
conn
,
'>>> '
)
conn
.
sendall
(
b'quit()
\
r
\
n
'
)
line
=
readline
(
conn
)
self
.
assertEqual
(
line
,
''
)
self
.
_close
(
conn
)
def
test_sys_exit
(
self
):
self
.
_make_server
()
...
...
@@ -80,6 +82,8 @@ class Test(greentest.TestCase):
response
=
read_until
(
conn
,
b'>>> '
)
self
.
assertEqual
(
response
[:
len
(
banner
)],
banner
,
response
)
self
.
_close
(
conn
)
def
test_builtins
(
self
):
self
.
_make_server
()
conn
=
self
.
_create_connection
()
...
...
@@ -88,6 +92,8 @@ class Test(greentest.TestCase):
response
=
read_until
(
conn
,
'>>> '
)
self
.
assertTrue
(
len
(
response
)
<
300
,
msg
=
"locals() unusable: %s..."
%
response
)
self
.
_close
(
conn
)
def
test_switch_exc
(
self
):
from
gevent.queue
import
Queue
,
Empty
...
...
@@ -110,10 +116,7 @@ class Test(greentest.TestCase):
response
=
response
.
replace
(
'
\
r
\
n
'
,
'
\
n
'
)
self
.
assertEqual
(
'switching out, then throwing in
\
n
Got Empty
\
n
switching out
\
n
switched in
\
n
>>> '
,
response
)
conn
.
sendall
(
b'quit()
\
r
\
n
'
)
line
=
readline
(
conn
)
self
.
assertEqual
(
line
,
''
)
conn
.
close
()
self
.
_close
(
conn
)
if
__name__
==
'__main__'
:
greentest
.
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