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
b74209a7
Commit
b74209a7
authored
Nov 12, 2018
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweak coverage of test__socket_dns.
parent
6e0ef748
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
30 deletions
+24
-30
src/gevent/_socketcommon.py
src/gevent/_socketcommon.py
+1
-1
src/gevent/tests/test__socket_dns.py
src/gevent/tests/test__socket_dns.py
+20
-28
src/gevent/tests/test__socket_dns6.py
src/gevent/tests/test__socket_dns6.py
+3
-1
No files found.
src/gevent/_socketcommon.py
View file @
b74209a7
...
...
@@ -225,7 +225,7 @@ if PY3:
def
_intenum_converter
(
value
,
enum_klass
):
try
:
return
enum_klass
(
value
)
except
ValueError
:
except
ValueError
:
# pragma: no cover
return
value
...
...
src/gevent/tests/test__socket_dns.py
View file @
b74209a7
...
...
@@ -383,13 +383,18 @@ class TestLocalhost(TestCase):
return
result
if
not
greentest
.
RUNNING_ON_TRAVIS
:
# ares fails here, for some reason, presumably a badly
# configured /etc/hosts
add
(
TestLocalhost
,
'ip6-localhost'
)
# Beginning Dec 1 2017, ares started returning ip6-localhost
# instead of localhost
add
(
TestLocalhost
,
'localhost'
)
add
(
TestLocalhost
,
'ip6-localhost'
,
skip
=
greentest
.
RUNNING_ON_TRAVIS
,
skip_reason
=
"ares fails here, for some reason, presumably a badly "
"configured /etc/hosts"
)
add
(
TestLocalhost
,
'localhost'
,
skip
=
greentest
.
RUNNING_ON_TRAVIS
,
skip_reason
=
"Beginning Dec 1 2017, ares started returning ip6-localhost "
"instead of localhost"
)
class
TestNonexistent
(
TestCase
):
...
...
@@ -407,10 +412,12 @@ add(Test1234, '1.2.3.4')
class
Test127001
(
TestCase
):
pass
if
not
greentest
.
RUNNING_ON_TRAVIS
:
# Beginning Dec 1 2017, ares started returning ip6-localhost
# instead of localhost
add
(
Test127001
,
'127.0.0.1'
)
add
(
Test127001
,
'127.0.0.1'
,
skip
=
greentest
.
RUNNING_ON_TRAVIS
,
skip_reason
=
"Beginning Dec 1 2017, ares started returning ip6-localhost "
"instead of localhost"
)
class
TestBroadcast
(
TestCase
):
...
...
@@ -440,7 +447,7 @@ class SanitizedHostsFile(HostsFile):
# We get extra results from some impls, like OS X
# it returns DGRAM results
or
name
==
'localhost'
)):
continue
continue
# pragma: no cover
if
name
.
endswith
(
'local'
):
# These can only be found if bonjour is running,
# and are very slow to do so with the system resolver on OS X
...
...
@@ -495,21 +502,6 @@ class TestFamily(TestCase):
cls
.
_result
=
getattr
(
socket
,
'getaddrinfo'
)(
TestGeventOrg
.
HOSTNAME
,
None
)
return
cls
.
_result
def
assert_error
(
self
,
error
,
function
,
*
args
):
# pylint:disable=arguments-differ
try
:
result
=
function
(
*
args
)
raise
AssertionError
(
'%s: Expected to raise %s, instead returned %r'
%
(
function
,
error
,
result
))
except
Exception
as
ex
:
if
isinstance
(
error
,
six
.
string_types
):
repr_error
=
error
else
:
repr_error
=
repr
(
error
)
if
type
(
ex
)
is
not
type
(
error
):
raise
if
repr
(
ex
)
==
repr_error
:
return
raise
def
test_inet
(
self
):
self
.
assertEqualResults
(
self
.
getresult
(),
gevent_socket
.
getaddrinfo
(
TestGeventOrg
.
HOSTNAME
,
None
,
socket
.
AF_INET
),
...
...
@@ -629,7 +621,7 @@ class TestInterrupted_gethostbyname(gevent.testing.timing.AbstractGenericWaitTes
# gaierror: [Errno -2] Name or service not known
try
:
gevent
.
get_hub
().
threadpool
.
join
()
except
Exception
:
# pylint:disable=broad-except
except
Exception
:
# pylint:disable=broad-except
pragma: no cover
traceback
.
print_exc
()
...
...
src/gevent/tests/test__socket_dns6.py
View file @
b74209a7
#!/usr/bin/python
# -*- coding: utf-8 -*-
from
__future__
import
print_function
,
absolute_import
,
division
import
gevent.testing
as
greentest
import
socket
from
test__socket_dns
import
TestCase
,
add
from
gevent.tests.
test__socket_dns
import
TestCase
,
add
from
gevent.testing.sysinfo
import
RESOLVER_NOT_SYSTEM
from
gevent.testing.sysinfo
import
RESOLVER_DNSPYTHON
...
...
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